ASP.NET 4.0 having many many new features. One of them is the RepeatLayout property for the CheckBoxList and RadioButtonList controls. The property is useful when we need decide how this controls will be render as html when its load in browser .
- <div>
- <asp:CheckBoxList ID="checkboxList" runat="server" RepeatLayout=UnorderedList>
- <asp:ListItem Text="Checkbox1" Value="1"></asp:ListItem>
- <asp:ListItem Text="Checkbox2" Value="2"></asp:ListItem>
- </asp:CheckBoxList>
- </div>
There are four options available there.
- Flow
- OrderedList
- Table
- UnorderedList
Flow: This option will render control with span tag. This option will be better when you need tables less html for your site.
OrderedList:This option will load contriol as orderedlist. It will load html with <ol> and <li> Tags.
Table:If you love table structure then this is the option for you it will load html with <table><tr> and <td> tags.
UnorderedList: This option will load control as UnorderedList. It will load with <ul> and <li> tags.
So this property will useful when you want to have more control over html rendering in your browser as per your requirement.
Happy Programming...
is the "unordered list" option compatible with "repeat columns"? eg will it render 2 unorderd lists in 2 diff divs if the repeat columns is 2?
ReplyDeletethx
--
Andrew
PS: MAKE THE IFRAME WRAPPING THIS COMMENT WIDGET TALLER - I HAD TO USE FIREBUG TO MAKE THE CAPTCHA VISIBLE
The UnorderedList and OrderedList layouts do not support multi-column layouts. Rest two option are supported with repeat column layout.
ReplyDelete