Class HyperLink and mouseover

  • Thread starter Thread starter Peter Eriksson
  • Start date Start date
P

Peter Eriksson

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.

Is this possible?

/Peter
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top