【发布时间】:2010-04-26 20:45:12
【问题描述】:
我正在设计的页面有一个奇怪的问题。我有一个这样的链接:
<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 标记...