我正在设计的页面有一个奇怪的问题。我有这样一个链接:与runat =“服务器”代理怪异的ASP.NET锚标记
<a id="asel1" runat="server" href="#"><img id="isel1" runat="server" src="/Images/selbar/1.jpg" /></a>
当我在结果页中查看源代码,我得到这样的:
<a href="../Cards/#" id="ctl00_ContentMainSection_CardsControl1_asel1"><img src="/Images/selbar/1.jpg" id="ctl00_ContentMainSection_CardsControl1_isel1" /></a>
我的目标是编程方式插入一个链接,如果它是适用于在本页面问题,并保留href =“#”,如果不是的话(基本上是一个空白的锚标签)。但是现在它会将它们带到一个实际的链接,这当然不存在。
我该如何让它停止这样做?
不设置在href = “#” 的工作?如果是空白锚标记,则不会呈现href标记... – Sunny 2010-04-26 20:55:38
http://stackoverflow.com/questions/2595113/using-htmlanchor-or-asp-net-hyperlink-for-anchor-tag-that - 在页面中导航命名? – R0MANARMY 2010-04-27 05:46:57