【问题标题】:Show "<hello world>" as Text in ASP.NET RadioButton在 ASP.NET RadioButton 中将“<hello world>”显示为文本
【发布时间】:2013-03-21 06:09:24
【问题描述】:

我想要一个 RadioButton 来显示像“”这样的文本(注意我想要显示“”字符,而不是被解释为 HTML 标记字符)。

试过这样的:

<asp:RadioButton ID="RadioButton1" runat="server"  Text="&lt;hello world&gt;" AutoPostBack="True"   />

但这不会在浏览器上显示任何文本,并在客户端呈现为:

<span class="radiobutton"><input id="ctl00_mainCopy_wizard_RadioButton1" type="radio" 
... />
<label for="ctl00_mainCopy_wizard_RadioButton1"><hello world></label></span>

有什么想法吗?

【问题讨论】:

    标签: asp.net webforms


    【解决方案1】:

    尝试双重转义。

    &amp;lt;hello world&amp;gt;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-08
      • 1970-01-01
      • 2017-08-26
      • 1970-01-01
      • 2017-10-11
      • 2016-10-29
      • 2013-04-02
      相关资源
      最近更新 更多