Solved

hyperlink mousemove

Posted on 2004-09-08
3
373 Views
Last Modified: 2012-05-05
how i can change the imageurl property from an hyperlink when the mouse pointer is over it?
0
Comment
Question by:Elvio Lujan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12009843
Add the following within the <HEAD></HEAD> section of the HTML of your aspx page.  

<script language=javascript>
function changeImage(imgCtl, newImgPath)
{
                // this'll work in IE, but probably not well cross browser.
     var ctl = document.getElementById(imgCtl);
     ctl.src = newImgPath;
}
</script>

Then in Page_Load if Page.PostBack == false, add the following: (Image1 is the image control).

this.Image1.Attributes.Add("onmouseover", "javascript:changeImage('" + this.Image1.ID + "', 'Images/Sunset.jpg');");
0
 
LVL 2

Expert Comment

by:sesurb
ID: 12009864
Hmm, hyperlink... seems like you would be better off using an imagebutton instead. Here is the code to use if you want to use an imagebutton.

Private Sub Page Load(blah, blah)
   ImageButton1.Attributes.Add("OnMouseOver", "this.src='/Common/images/btn_Cancel.gif'")
   ImageButton1.Attributes.Add("OnMouseOut", "this.src='/Common/images/btn_Submit.gif'")
End Sub
0
 
LVL 2

Accepted Solution

by:
sesurb earned 500 total points
ID: 12009877
if you use the image button then just add a redirect to the event of the button

Private Sub ImageButton1_Click(blah, blah)
     Response.Redirect("http://www.newpage.com")
End Sub
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question