【问题标题】:How to add multiple Text to asp:label control?如何将多个文本添加到 asp:label 控件?
【发布时间】:2017-02-07 22:18:16
【问题描述】:

我目前有一个从字符串文件中提取文本的 asp 标签。我想在此标签旁边添加一个红色 *。我该怎么做呢?

<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/> 

【问题讨论】:

    标签: c# html asp.net


    【解决方案1】:

    您可以执行以下操作。只需在您的标签标签右侧添加一个span 标签,其样式属性的值为color: red

    像这样:

     <asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/><span style="color:red;">*</span>
    

    【讨论】:

      【解决方案2】:

      如果您想要 * 以及相同的文本,则应该可以:

      <asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %> <span style='color: red;'>*</span>"/>
      

      如果你想要在 seperaret 中,还有另一种选择:

       <asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/><span style="color:red;">*</span> 
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-02-22
        • 1970-01-01
        • 2012-03-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-11-23
        • 1970-01-01
        相关资源
        最近更新 更多