Solved

hyperlink mousemove

Posted on 2004-09-08
3
369 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
  • 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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