Question about an image

  • Thread starter Thread starter Sergey Poberezovskiy
  • Start date Start date
S

Sergey Poberezovskiy

You have to look within client events, not server.

And to achive what you want you will need to define:
onmousemove and onmouseout events:
<img id="myImg" src="mySource" runat="server" (this is
optional) onmousemove="javascript:functionToChangeImage()"
onmouseout="javascript:functionToChangeImageBack()" >

HTH
 
And does this also work with an <asp:image>?


Sergey Poberezovskiy said:
You have to look within client events, not server.

And to achive what you want you will need to define:
onmousemove and onmouseout events:
<img id="myImg" src="mySource" runat="server" (this is
optional) onmousemove="javascript:functionToChangeImage()"
onmouseout="javascript:functionToChangeImageBack()" >

HTH
 
I do not see why not. Try this:

<asp:image id="myImg" alternateText="some text"
imageUrl="mySource" runat="server"
onmouseover="window.status='inside image';return true;"
onmouseout="window.status=''; return true;"></asp:Image>

Works for me - just ignore the IDE warnings - it will turn
out fine on the browser - or the browser will ignore them.

HTH
 
Yes. If you insist on using it, you should add event handlers to Attributes
collection. But <asp:image> is not better then <img runat="server">.

Eliyahu
 
This syntax is not documented. Client attributes do work when specified
directly for server controls, but noone can gurantee they will still work in
future releases. The legal and very simple way is using Attributes in
code-behind.

Eliyahu
 
Back
Top