Search code examples
asp.netasp.net-2.0radiobuttonlist

ASP.NET - How to add a label to a RadioButtonList ListItem?


I have a RadioButtonList with two ListItems included:

<asp:RadioButtonList runat="server" ID="optRollover" OnSelectedIndexChanged="RolloverOptionSelected" AutoPostBack="true">
                    <asp:ListItem Value="0">100% </asp:ListItem>
                    <asp:ListItem Value="1">Less than 100%</asp:ListItem>
</asp:RadioButtonList><br />               

On the first ListItem I need to have a label that displays some text from the code behind of the page. Logically it seems to me like I would be able to do something like this: 100%

Obviously this does not work because I am getting an error: The 'Text' property of 'asp:ListItem' does not allow child objects.

Can anyone think of a way around this constraint?


Solution

  • I ended up fixing this by placing a below the RadioButtonList with relative positioning. Fixed me right up. Thanks for viewing.