C# 有没有办法禁用标签?

C# 有没有办法禁用标签?,c#,asp.net,javascript,C#,Asp.net,Javascript,我使用asp单选按钮组在表单中列出答案。下面是一个结构示例 <asp:RadioButtonList id="Q2" runat="server"> <asp:ListItem Text="Go to <a target='_blank' href='http:www.google.com'>Google</a>" Value="a"></asp:ListItem> <asp:ListItem Text="Go

我使用asp单选按钮组在表单中列出答案。下面是一个结构示例

<asp:RadioButtonList id="Q2" runat="server">
    <asp:ListItem Text="Go to <a  target='_blank' href='http:www.google.com'>Google</a>"  Value="a"></asp:ListItem>
    <asp:ListItem Text="Go to <a  target='_blank' href='http:www.yahoo.com'>Yahoo</a>"  Value="a"></asp:ListItem>
 </asp:RadioButtonList>
“Value=“a”>
“Value=”a“>
所以我希望能够点击链接,而不是让与之相关的单选按钮被选中。在IE中,它可以正常工作,但在Firefox中,当我点击链接时,单选按钮将被选中。我真的不需要标签来选择正确的单选按钮,所以有没有办法在javascript或asp或C代码中禁用它们?

试试以下方法:

<a  target='_blank' href='http:www.google.com' click='return false;'>Google</a>"

毫无疑问,它将它们包装在一个
标签
元素中,该元素为您提供选择行为。您可以手动生成代码(我的选择),也可以在客户端使用javascript将其展开

<div>
    <input type="radio" name="Q2" id="Q2_google" value="google" /> <a target="_blank" href="http://www.google.com">Google</a>
    ...
</div>
您可以在ListItem级别使用Enabled=“false”

例:
Google“Value=“a”Enabled=“false”>

生成的HTML是什么样子的?浏览器从未看到ASP代码。是的,jquery看起来是解决我注意到的大多数编码问题的方法。
 $(function() {
     $('label:has(a)').each( function() {
         var html = $(this).html();
         $(this).replaceWith($(html));
     });
 });