Can someone tell me how to deal with MouseOver with image button?

I want to change image of my ImageButton Server control on mouse over and mouse out how can I achive this.

Following sample code shows how to add mouseover and mouseout events to ImageButton control

Run sample code


<%@ Page Language="C#"%>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form runat="server">
        <asp:ImageButton runat="server" 
            ID="MyImageButton"  
            ImageUrl="Background.png" 
            onmouseover="this.src='Background1.png'"
            onmouseout="this.src='Background.png'"/>
    </form>
</body>
</html>
Bookmark with:
Technorati   Digg   Delicious   StumbleUpon   Facebook
My name is Jigar Desai I share my ideas on this site and you can contact me by filling contact form.

Categories