Mega Code Archive

 
Categories / ASP.Net Tutorial / ASP Net Controls
 

Adding ListItems Declararatively

<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">     <title>CheckBoxList Control</title> </head> <body>     <form id="form1" runat="server">     <div>     <h1>CheckBoxList Control</h1>     <h2>Adding ListItems Declararatively</h2>      <asp:CheckBoxList ID="cblItems" runat="server" AutoPostBack="True" CellPadding="5" CellSpacing="10" RepeatColumns="3" RepeatDirection="Horizontal" RepeatLayout="Flow" TextAlign="Left">          <asp:ListItem> Item 1 </asp:ListItem>             <asp:ListItem> Item 2 </asp:ListItem>          <asp:ListItem> Item 3 </asp:ListItem>          <asp:ListItem> Item 5 </asp:ListItem>          <asp:ListItem> Item 6 </asp:ListItem>      </asp:CheckBoxList>          </div>     </form> </body> </html>