Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everyone,

 

I'm having a problem I can't quite understand with a mouse over that I am trying to do in a user control. I want the image to change when the user hovers over it and back to the original on mouseout. Here is the code I am using.

 

<IMG id="home" style="Z-INDEX: 101; LEFT: 1px; POSITION: absolute; TOP: 1px" alt="" src="file:///C:\Inetpub\wwwroot\testweb\images\home_off.gif" onmouseover="home.src='file:///C:\Inetpub\wwwroot\testweb\images\home_on.gif';" onmouseout="home.src='file:///C:\Inetpub\wwwroot\testweb\images\home_off.gif';">

 

this seems compliant with code I have verified from MSDN and the following article:

http://www.wdvl.com/Authoring/ASP/NET_Nutshell/asp_net1_2.html

 

the issue I have is that is gives me the typical "x" as an image after I hover over the image - as if it can't find the image. I am able to add both images directly onto the user control and can browse directly to the image if I put the url in the browser.

 

any ideas?

 

thanx again,

 

inzo

he who forgets will be destined to remember... (E.Vedder)
Posted

that did it!

 

one other question... do you know a way that I can reference the image based on the root of the web site rather than hard-coding it? I tried ../testweb/images/home_off.gif to no avail.

 

other than that, thank you so much for your feedback.

 

have a great day

inzo

he who forgets will be destined to remember... (E.Vedder)
Posted

scratch that - I removed a period and it works.

 

./images/home_off.gif

 

thanx again,

 

inzo

he who forgets will be destined to remember... (E.Vedder)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...