Reputation: 46282
I have the following -
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Vertical" RepeatLayout="Table" CssClass="RBL" TextAlign="Right">
<asp:ListItem Text= "Individual - This is for user" />
<asp:ListItem Text="Enterprise - This is for enterprises" />
</asp:RadioButtonList>
What I like to do is to underline just Individual and Enterprise.
I tried something like the following but did not work:
<asp:ListItem Text= <span class="underline"> Individual </span>-....
as I got:
Error 71 The 'Text' property of 'asp:ListItem' does not allow child objects.
Upvotes: 0
Views: 5975
Reputation: 7591
You can add your text outside of the Text attribute:
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Vertical" RepeatLayout="Table" CssClass="RBL" TextAlign="Right">
<asp:ListItem> <span class="underline">Individual</span> - This is for user </asp:ListItem>
<asp:ListItem> <span class="underline">Enterprise</span> - This is for enterprises </asp:ListItem>
</asp:RadioButtonList>
Upvotes: 1
Reputation: 62290
You want single quote - '.
<style type="text/css">
.underline { text-decoration: underline; }
</style>
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Vertical" RepeatLayout="Table" CssClass="RBL" TextAlign="Right">
<asp:ListItem Text="<span class='underline'>Individual</span> - This is for user" />
<asp:ListItem Text="<span class='underline'>Enterprise</span> - This is for enterprises" />
</asp:RadioButtonList>
Upvotes: 3
Reputation: 9279
You can use HTML in the Text value for the ListItems:
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Vertical" RepeatLayout="Table" CssClass="RBL" TextAlign="Right">
<asp:ListItem Text= "<u>Individual</u> - This is for user" />
<asp:ListItem Text= "<u>Enterprise</u> - This is for enterprises" />
</asp:RadioButtonList>
Upvotes: 0