Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

hyperlink mousemove

Posted on 2004-09-08
3
Medium Priority
?
374 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

704 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