I'm new to asp.net. I tried to change the image of an asp.net imageButton, using this code:
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="/Images/blueButton.png" Width="137px" Height="34px" onmouseover="this.ImageUrl='/Images/greenButton.png'" onmouseout="this.ImageUrl='/Images/blueButton.png"/>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="/Images/blueButton.png" Width="137px" Height="34px"
<asp:ImageButton> runs on the server. These are two separate domains.
ASP.NET renders the
<asp:ImageButton> as an HTML
<img src="/Images/blueButton.png"> on the server and sends it to the client, and then the mouse event can access it's DOM property named
src at the client.
Look at the HTML source from your browser to see the difference between what you wrote in your ASPX file and the HTML the browser receives.