473,788 Members | 2,988 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Class HyperLink and mouseover

I am making a link with the HyperLink-class like this:

HyperLink link = new HyperLink();
link.NavigateUr l = "http://www.page.com";
link.Text = "Some text";
link.ImageUrl="/images/linkimage.gif";

What I would like to do is to show another image for the link on the
mouseover event.

Is this possible?

/Peter
Nov 17 '05 #1
2 2626
Hi,

are you developing a windows or a WebForms (ASP.NET) application?
What I would like to do is to show another image for the link on the
mouseover event.


in case of ASP.NET:
ASP.NET is a server-side technology, in other words, you can't execute
code on client-side events (like mouseover).

You have to use JavaScript to do that.

Nov 17 '05 #2
Peter,

Probably not. If anything, you would have to create a new class that
derives from HyperLink, and then have that class inject the javascript code
for the rollover effect.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Peter Eriksson" <pe************ ****@telia.com> wrote in message
news:O6******** ******@TK2MSFTN GP12.phx.gbl...
I am making a link with the HyperLink-class like this:

HyperLink link = new HyperLink();
link.NavigateUr l = "http://www.page.com";
link.Text = "Some text";
link.ImageUrl="/images/linkimage.gif";

What I would like to do is to show another image for the link on the
mouseover event.

Is this possible?

/Peter

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6032
by: addi | last post by:
All, I have seen the feature on many sites and would like to implement it for myself as well, where if a mouse is moved over a hyperlink, it gets underlined. For example, in my code, if the mouse is moved over "home" or gets the focus, I would like it to be underlined. <html> <body> <font face="Arial, Helvetica, sans-serif" size="1" color="#999999">
2
1811
by: wazoo | last post by:
I'm hoping someone here might help me with this. I'm putting the finishing touches on my intranet web app, and I'm adding some simple JavaScript to my VB.Net Webforms. This works: Button1.Attributes.Add("onmouseover", "this.style.backgroundColor=""Blue""") Button1.Attributes.Add("onmouseout", "this.style.backgroundColor=""Navy""") And this works:
1
1130
by: Peter Eriksson | last post by:
I am making a link with the HyperLink-class like this: HyperLink link = new HyperLink(); link.NavigateUrl = "http://www.page.com"; link.Text = "Some text"; link.ImageUrl="/images/linkimage.gif"; What I would like to do is to show another image for the link on the mouseover event.
1
1654
by: vishal | last post by:
I am using a datagrid where there is a hyperlink column. On mouseover I get the whole link in the status bar which I want to put some static message or mask it. How do I achive this in .net? If any one knows the script or any other method just let me know that with some sample code. regards vishal.
1
2061
by: mjryan | last post by:
Any idea why this code would not fire? btnMakePmt.Attributes.Add("onMouseOver", "this.src='img\\MakePmt_nav2_over.jpg'") btnMakePmt.Attributes.Add("onMouseOut", "this.src='img\\MakePmt_nav2.jpg'") I have two other Image buttons that this code works fine with. The btnMakePmt is an asp.net hyperlink control. I need this to remain a hyperlink so I can use the Target attribute to display it in a new window instead of the current browser...
8
3800
by: Nathan Sokalski | last post by:
I have several System.Web.UI.WebControls.HyperLink Controls which I want to display as rollover images. I know how to make these manually using the <a> and <img> tags or the <a> tag and a System.Web.UI.WebControls.Image Control or a HyperLink and Image Controls, but the onMouseOver and onMouseOut attributes must be in the <img> tag. If I were to use the HyperLink's ImageUrl property and add the attributes using the...
1
1548
by: Peter Morris | last post by:
Newbie q. how do I change the image url for a hyperlink on mouseover? I have a menubar, and I want to highlight the selected item.
5
5530
by: Dave | last post by:
I've been given a flash banner and told to make it a hyperlink. I tried this: <script type="text/javascript"> Document.getElementById("flashcontent").onclick = function(){ window.location='http://www.website.com'; } </script> but received an error stating that "Document" was undefined. I also tried this:
4
8149
by: Mat | last post by:
How do you modify the color of an hyperlink when your mouse go over it? <asp:HyperLink
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.