C# 如何向asp:label控件添加多个文本?
我目前有一个asp标签,它从字符串文件中提取文本。我想在这个标签旁边加一个红色的*。我该怎么做呢C# 如何向asp:label控件添加多个文本?,c#,html,asp.net,C#,Html,Asp.net,我目前有一个asp标签,它从字符串文件中提取文本。我想在这个标签旁边加一个红色的*。我该怎么做呢 <asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/> 您可以执行以下操作。只需在标签标签的右侧添加一个span标签,其样式属性的值为color:red 像这样: <asp:Label ID="Label29" runat
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/>
您可以执行以下操作。只需在标签标签的右侧添加一个
span
标签,其样式属性的值为color:red
像这样:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/><span style="color:red;">*</span>
*
如果您想将*
与相同的文本一起使用,则此操作应有效:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %> <span style='color: red;'>*</span>"/>
除此之外,如果您想在Separaret中使用,还有另一种选择:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/><span style="color:red;">*</span>
*