CheckBoxList and RadioButtonList Control Specify layout in ASP.Net 4

In ASP.NET 4, the CheckBoxList and RadioButtonList controls support the following new values for the RepeatLayout property:

* OrderedList – The content is rendered as li elements within an ol element.
* UnorderedList – The content is rendered as li elements within a ul element.

You can use these values like below :

<asp:CheckBoxList ID="CheckBoxList1" runat="server"
<asp:ListItem Text="CheckBoxList" Value="cbl" />

<asp:RadioButtonList ID="RadioButtonList1" runat="server"
<asp:ListItem Text="RadioButtonList" Value="rbl" />

The HTML OutPut would be :

<ol id="CheckBoxList1">
<li> <input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" value="cbl" /> <label for="CheckBoxList1_0"> CheckBoxList</label> </li>

<ul id="RadioButtonList1">
<li> <input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="rbl" /> <label for="RadioButtonList1_0"> RadioButtonList</label> </li>



This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at .

Copyright (c) 2010 @ All rights are reserved.Do Not Copy.

@ Learning