Why a radiobuttonlist always take a new row? Why a radiobuttonlist always take a new row? asp.net asp.net

Why a radiobuttonlist always take a new row?


RadioButtonList by default renders as table. You can change set the property RepeatLayout="Flow" and it will be rendered in span.

RepeatLayout Property

Different ways it can render


Add a property to your radiobuttonlist

RepeatDirection="Horizontal"

   <asp:RadioButtonList RepeatDirection="Horizontal"         ID="RadioButtonList1" runat="server" style="display:inline">        <asp:ListItem>asdf</asp:ListItem>        <asp:ListItem>sdfg</asp:ListItem>    </asp:RadioButtonList>

this will solve your problem. CHEERS


You can set it's display style to be inline:

<asp:RadioButtonList    ID="RadioButtonList1" runat="server" style="display:inline">    <asp:ListItem>asdf</asp:ListItem>    <asp:ListItem>sdfg</asp:ListItem></asp:RadioButtonList>

Warning: Purists will scream that information should be in a CSS class somewhere else.