Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler?

Q

Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler?

✍: Guest

A

It’s the Attributesproperty,
the Add function inside that property. So

btnSubmit.Attributes.Add("onMouseOver","someClientCode();")

A simple”Javascript:ClientCode();” in the button control of the .aspx page will attach the handler (javascript function)to the onmouseover event.

2014-03-07, 1793👍, 0💬