Skip to main content

Adding an Anchor to a ASP:Hyperlink

Back-end Development

I came across the need to use an ol' fashioned anchor today and realized that the ASP hyperlink control doesn't handle this well.  A simple solution to this is to slap a "onclick" handler on the control.  Like so...

hlTop.Attributes.Add("onclick", "this.href='" + hlTop.NavigateUrl + "';");

HTH

Need a fresh perspective on a tough project?

Let’s talk about how RDG can help.

Contact Us