Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.net Hyperlink control equivalent to <a href="#"></a>

Tags:

I wanted to define a HyperLink control in asp.net that produces html output similar to the following:

<a href="#"></a> 

but can't figure out how. would be thankful if anyone could help.
Thanks in advance.

like image 541
mohas Avatar asked Mar 16 '12 22:03

mohas


People also ask

What is hyperlink in C#?

The hyperlink is the control to link another page. The hyperlink can navigate to “URL” as well as xaml page. The HyperLink Control is the control to link to another page.

How do you hyperlink in Visual Studio?

Select an existing control or drag and drop a control from the Visual Studio toolbox onto the design surface. Right-click the control to open the Properties Window. In the Properties Window, set the HyperLink property to mailto: any valid e-mail address.


2 Answers

I agree with SLaks, but here you go

   <asp:HyperLink id="hyperlink1"                    NavigateUrl="#"                   Text=""                   runat="server"/>  

or you can alter the href using

hyperlink1.NavigateUrl = "#";  hyperlink1.Text = string.empty; 
like image 74
Ian G Avatar answered Oct 14 '22 04:10

Ian G


Just write <a href="#"></a>.

If that's what you want, you don't need a server-side control.

like image 38
SLaks Avatar answered Oct 14 '22 06:10

SLaks