17 February 2014

Bulleted lists - Basic Web Controls

         The bulleted list control creates bulleted lists or numbered lists. These controls contain a collection of List Item objects that could be referred to through the Items property of the control.
Basic syntax of a bulleted list:
<asp:bulleted lists id="bulletedlist1" runat="server"></asp:bulleted lists>
Common Properties of the Bulleted List:
   Bullet Style:This property specifies the style and looks of the bullets
  
  Repeat Direction:It specifies the direction in which the controls to be repeated. The values available are horizontal and vertical ,default is Vertical

  Repeat Columns: It specifies  the number of columns to use when repeating the controls,default is 0



Sample for Bulleted List:


  1. <%@ Page Language="C#" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4.   
  5. <script runat="server">  
  6.   
  7. </script>  
  8.   
  9. <html xmlns="http://www.w3.org/1999/xhtml">  
  10. <head runat="server">  
  11.     <title>BulletedList Control Example</title>  
  12. </head>  
  13. <body>  
  14.     <form id="form1" runat="server">  
  15.     <div>  
  16.         <asp:BulletedList ID="BulletedList1" runat="server">  
  17.             <asp:ListItem>ColdFusion</asp:ListItem>  
  18.             <asp:ListItem>PHP</asp:ListItem>  
  19.             <asp:ListItem>Asp.Net</asp:ListItem>  
  20.             <asp:ListItem>JSP</asp:ListItem>  
  21.         </asp:BulletedList>  
  22.     </div>  
  23.     </form>  
  24. </body>  
  25. </html>  

Change BulletStyle Property 

You can change the Bullet Style property. It's support various format. Here a sample code.

  1. <form id="form1" runat="server">  
  2. <div>  
  3.  <asp:BulletedList ID="BulletedList1" runat="server" BulletStyle="Numbered">  
  4.   <asp:ListItem>ColdFusion</asp:ListItem>  
  5.   <asp:ListItem>PHP</asp:ListItem>  
  6.   <asp:ListItem>Asp.Net</asp:ListItem>  
  7.   <asp:ListItem>JSP</asp:ListItem>  
  8.  </asp:BulletedList>  
  9. </div>  
  10. </form>  




No comments:

Post a Comment