BulletedList control in ASP.NET

In this article we will learn how to use BulletedList control in ASP. NET.
  • 2735


In this article we will learn how to use BulletedList control in ASP. NET.

BulletedList control:

Displaying items in a bullet format is a good and clean presentation of data. The BulletedList control is used to create a list of items formatted with bullets. The order list like <ul> and <li> tags are frequently use especially when we want to display a list of items in list / point format.

Properties: BulletedList control has the following properties.


Figure 1.


The collection of items in the list.


Figure 2.


  • HyperLink: Each list item is rendered as a link to another page.
  • LinkButton: Each list item is rendered by a LinkButton control.
  • Text: Each list item is rendered as plain text.

    Figure 3.


    Style of the border around the control. BorderStyle can be following type.

    1. Dotted
    2. Hashed
    3. Solid
    4. Double
    5. groove
    6. Ridge
    7. Inset
    8. Outset

    Figure 4.



    This style are used for Bullets. BulletStyle can be following type.

    1. Numbered
    2. LowerAlpha
    3. UpperAlpha
    4. LowerRoman
    5. UpperRoman
    6. Disc
    7. circle
    8. Square
    9. CustomImage

    Figure 5.


    For example:

    Drag BulletedList control on the form and set DisplayMode property on hyperlink. The page given below displays a list of links to other websites.


    Figure 6.

    Now click on the source button of the design window.


    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication31.WebForm1" %>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">




    <h3><font face="Verdana">Bulleted List</font></h3>


        <form id="form1" runat="server">



            <asp:BulletedList ID="BulletedList1" DisplayMode = HyperLink runat=server>

                <asp:ListItem Value="http://google.com">Search</asp:ListItem>

                <asp:ListItem Value="http://www.asp.net">ASP.NET</asp:ListItem>

                <asp:ListItem Value="http://vbdotnetheaven.com">VB.NET</asp:ListItem>






    Now save and run the application.


    Figure 7.

    Numbered Bullet list:

    Set the property BulletStyle -> numbered.

    Figure 8.


More Articles

© 2020 DotNetHeaven. All rights reserved.