Click here to Skip to main content
15,907,910 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want an ASP.NET function (client side) executed on the MouseOver event of a button. Where do you add an event handler?
Posted
Comments
hafizAkhtarHussain 9-Jun-13 8:32am    
its working fine

1 solution

Here is a sample

ASP.NET
<asp:button id="btn1" runat="server" text="submit" />


Javascript function to be called onMouseOver event
JavaScript
function Samplefunction()
{
    alert('On mouse over event!');
}



In your code behind file you include the following code in Page_Load event handler
C#
btn1.Attributes.Add("onmouseover", "Samplefunction()");
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900