Webform controls events

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
 
A

AW

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.
 
T

Teemu Keiski

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top