Webform controls events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi! I have a webform with a label control on it, and I would like to place some piece of code in the 'onmouseover' event of the control, but I can't find it on the list of the control events. Is this normal? Is there a way to declare it mannually? By the way, I'm using VB.NET.
Thanks,

Sérgio
 
Hi Sergio,

You can either:
*in the code write
Label1.Attributes.Add("onmouseover","javascript:yourFunction()")
*in the ASPX page, add this attribute to the label:
<asp:Label Text="..." onmouseover="javascript:yourFunction()">

In the second case, VS.net won't recognize it but it works alright.
 
Are you sure as it would mean that it would cause a postback when user moves
mouse over ther label? Could be very annoying feature is misused.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

Spop said:
Hi! I have a webform with a label control on it, and I would like to place
some piece of code in the 'onmouseover' event of the control, but I can't
find it on the list of the control events. Is this normal? Is there a way to
declare it mannually? By the way, I'm using VB.NET.
 
Back
Top