Solved

hyperlink mousemove

Posted on 2004-09-08
3
367 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:lem2802
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now