Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
for example i have this radio button.

HTML
(o) item1  (o) item 2


however, i want it to be like:

HTML
(o) item1   (o) item2
  line here   line here


My current markup is:

ASP.NET
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal" Width="650px" Font-Size="Smaller">
    <asp:ListItem Selected="True" Value="0">Relax<br>(MY MAN)</asp:ListItem>
    <asp:ListItem Value="1">Relax Again<br>(My Man)</asp:ListItem>
    <asp:ListItem Value="2">Relax Again 2<br>(MyMan)</asp:ListItem>
    <asp:ListItem Value="3">Relax 3<br>(My Man)</asp:ListItem>
    <asp:ListItem Value="4">Relax 4<br>(My Man)</asp:ListItem>
    <asp:ListItem Value="5">Relax 5<br>(My Man)</asp:ListItem>
    <asp:ListItem Value="6">Relax 6<br>(My Man)</asp:ListItem>
</asp:RadioButtonList>


But it generates the following validation error messages: the element 'br' cannot be nested within the element 'listitem'.

What I have tried:

i tried googling for this but found no possible answer. Please help Thanks. Even tried replacing br with br /
Posted
Updated 2-May-16 7:30am
v6
Comments
Patrice T 2-May-16 12:28pm    
What is your question ?
JT1992 2-May-16 12:29pm    
the whole thing above the line. my issue is that i dont want to receive that warning.
ZurdoDev 2-May-16 12:39pm    
1. Reply to the comment so that the user is notified.
2. I think what you are asking is that you want a line break in your listItem's text? Is that right?

It's confusing because you have item1, item2 in your description but then you show Relax, Relax Again, etc.
JT1992 2-May-16 13:20pm    
yes thats correct! i want a line break between each and that error to dissappear

use Text Property

ASP.NET
 <asp:label text="text" id="lbl_total_users" runat="server" xmlns:asp="#unknown" /> <br />
    <asp:radiobuttonlist id="RadioButtonList1" runat="server" repeatdirection="Horizontal" width="650px" font-size="Smaller" xmlns:asp="#unknown">
    <asp:listitem selected="True" value="0" text="Relax <br>(MY MAN)"></asp:listitem>
    <asp:listitem value="1" text="Relax Again<br>(My Man)"></asp:listitem>
    <asp:listitem value="2" text="Relax Again 2<br>(MyMan)"></asp:listitem>
    <asp:listitem value="3" text="Relax 3<br>(My Man)"></asp:listitem>
    <asp:listitem value="4" text="Relax 4<br>(My Man)"></asp:listitem>
    <asp:listitem value="5" text="Relax 5<br>(My Man)"></asp:listitem>
    <asp:listitem value="6" text="Relax 6<br>(My Man)"></asp:listitem>
</asp:radiobuttonlist>
 
Share this answer
 
Comments
JT1992 2-May-16 14:10pm    
Perfect!. Thanks a lot
Karthik_Mahalingam 2-May-16 14:17pm    
welcome :)
Quote:
the whole thing above the line. my issue is that i don't want to receive that warning.
Simple, remove the <br> from your List Items.

[UpDate]
If you want a <br> in List Items and SQP don't want, I think we have a case of divorce.
 
Share this answer
 
v2
Comments
ZurdoDev 2-May-16 13:24pm    
Yes, that gets rid of the error of course, but OP's real question is how to get a line break in the item.
JT1992 2-May-16 14:11pm    
lol. good one!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900