Asp.net超链接控制相当于< a href ="#">< / a>

问题描述:

我想在asp.net中定义一个HyperLink控件,它产生类似于以下内容的html输出:

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.

我同意SLaks,但是你去吧

I agree with SLaks, but here you go

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

或者你可以改变href使用

or you can alter the href using

hyperlink1.NavigateUrl = "#"; 
hyperlink1.Text = string.empty;