MouseOver Image in Master Pages
Posted on 2007-11-16
Hi Experts !
I need some help please with using MouseOver on some images in my MasterPage
I have a button that I want to replace with different image when I do OnMouseOver and OnMouseOut.
Simple , right ?
So I did:
<asp:ImageButton ID="btnWeddings" runat="server" ImageUrl="~/Images/weddingBtn.gif" onmouseover="this.src='Images/weddingPressedBtn.gif';" onmouseout="this.src='Images/weddingBtn.gif';" OnClick="ImageButton4_Click"/>
It works as long as I stay on the same page.
Here is a problem... As soon as the MasterPage pulls content from another page OnMouseOver and OnMouseOut images break.
I tried using:
But ~/ doesn't seem to work with events like OnMouseOver for some reason.
I also tried adding to the page load event:
It only works with direct path such as Images/.... breaking the whole thing if I pull content from another page.
Thank you in advance !