BulletedListDisplayMode Enumeration
Collapse the table of content
Expand the table of content

BulletedListDisplayMode Enumeration


Specifies the display behaviors that you can apply to the list item contents in a BulletedList control.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public enum BulletedListDisplayMode

Member nameDescription

Displays the list item content as hyperlinks.


Displays the list item content as link buttons.


Displays the list item content as text.

The BulletedListDisplayMode enumeration represents the display behaviors that you can apply to the content of the list items in a BulletedList control. The DisplayMode property uses these enumeration values to set the display behavior of the list item content in a BulletedList control. For example, if you set the DisplayMode property to the HyperLink value, the content of each list item in the BulletedList control renders as a hyperlink.

The Text value allows you to display the list item content as regular text with no additional functionality.

The HyperLink value allows you to display list item content as hyperlinks. When clicked, a hyperlink navigates to a URL. Use the Value property to specify the URL that a hyperlink navigates to.

The LinkButton value allows you to display list item content as link buttons. Use the BulletedList.Click event to post back to the server when the user clicks a link button. Use the event data of the BulletedListEventArgs class to determine the index of the link button in a BulletedList that the user clicked.

The following code example demonstrates how to create a BulletedList control and set the DisplayMode property. A ListBox control is populated with the BulletedListDisplayMode values. The format of the list item content changes based on the display mode that the user selects from the list box.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
            BulletStyle Example</title>
<script runat="server">       
        protected void Index_Changed(object sender, EventArgs e)
            // Change the message displayed, based on 
            // the style selected from the list box.
            if (BulletStylesListBox.SelectedIndex > -1)
                Message.Text = "You selected bullet style: " +

            // Change the bullet style used, based on 
            // the style selected from the list box.
            switch (BulletStylesListBox.SelectedIndex)
                case 0:
                    ItemsBulletedList.BulletStyle = BulletStyle.Numbered;
                case 1:
                    ItemsBulletedList.BulletStyle = BulletStyle.LowerAlpha;
                case 2:
                    ItemsBulletedList.BulletStyle = BulletStyle.UpperAlpha;
                case 3:
                    ItemsBulletedList.BulletStyle = BulletStyle.LowerRoman;
                case 4:
                    ItemsBulletedList.BulletStyle = BulletStyle.UpperRoman;
                case 5:
                    ItemsBulletedList.BulletStyle = BulletStyle.Disc;
                case 6:
                    ItemsBulletedList.BulletStyle = BulletStyle.Circle;
                case 7:
                    ItemsBulletedList.BulletStyle = BulletStyle.Square;
                case 8:
                    ItemsBulletedList.BulletStyle = BulletStyle.CustomImage;
                    // Specify the path to the custom image to use for the bullet.
                    ItemsBulletedList.BulletImageUrl = "Images/image1.jpg";
                case 9:
                    Message.Text = "You selected NotSet. The browser will determine the bullet style.";
                    throw new Exception("You did not select a valid bullet style.");


    <form id="form1" runat="server">
            BulletStyle Example</h3>
        <asp:BulletedList ID="ItemsBulletedList" DisplayMode="Text" BulletStyle="NotSet"
            <asp:ListItem Value="0">Coho Winery</asp:ListItem>
            <asp:ListItem Value="1">Contoso, Ltd.</asp:ListItem>
            <asp:ListItem Value="2">Tailspin Toys</asp:ListItem>
        <hr />
            Select a bullet type:</h4>
        <asp:ListBox ID="BulletStylesListBox" SelectionMode="Single" Rows="1" OnSelectedIndexChanged="Index_Changed"
            AutoPostBack="True" runat="server">
            <asp:ListItem Value="Numbered">Numbered</asp:ListItem>
            <asp:ListItem Value="LowerAlpha">LowerAlpha</asp:ListItem>
            <asp:ListItem Value="UpperAlpha">UpperAlpha</asp:ListItem>
            <asp:ListItem Value="LowerRoman">LowerRoman</asp:ListItem>
            <asp:ListItem Value="UpperRoman">UpperRoman</asp:ListItem>
            <asp:ListItem Value="NotSet">NotSet</asp:ListItem>
        <hr />
        <asp:Label ID="Message" runat="server" AssociatedControlID="BulletStylesListBox" />

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft