asp.net.ph

Skip Navigation Links

Introduction to the BulletedList Control

Controls You Can Use on Web Forms   ASP.NET Standard Controls   BulletedList Control


The BulletedList Web server control is a flexible control that displays data as a bulleted list of items, and provides the ability to select an item from the list.

The contents of a BulletedList control can be set directly in the control, or by binding the control to a data source.

The content, behavior, and appearance of a BulletedList control can all be decided at design time, using simple declarative syntax. The control, though, supports programmatic access to the ListControl object model ( from which it derives ), enabling developers to extend the control’s basic functionality, such as to create lists, populate list items, set list properties, and so on, dynamically.

The following sections briefly introduce the main features of the BulletedList control.

Defining BulletedList Content

Basically, a BulletedList control is made up of ListItem objects. Each list item has a Text property, which is what displays in the BulletedList control.

How a list item is diplayed and behaves in the BulletedList control depends basically on two settings: BulletStyle and DisplayMode.

Bullet Styles

The BulletStyle property can be set to one of the BulletStyle enumeration values to specify the bullet style to use in a BulletedList control.

For example, if you set the BulletStyle property to Disc, each list item in a BulletedList control will render a filled circle preceding the content of the list item as follows:

Specifying the CustomImage bullet style allows you to supply your own image for the bullet. If you specify the CustomImage bullet style, you must also set the BulletImageUrl property to the URL of the custom image to use.

If not specified ( which defaults to NotSet ), the browser in which the control is rendered will determine the bullet style to display with the list items in the BulletedList control.

Display Modes

The DisplayMode property can be set to one of the BulletedListDisplayMode to specify the display behavior of the list item content in a BulletedList control.

When not specified, DisplayMode defaults to the Text value, which displays the list item content as regular text with no additional functionality.

The HyperLink value displays list item content as hyperlinks which, when clicked, navigates to a URL. To specify the URL that a hyperlink navigates to, use the Value property.

The LinkButton value displays list item content as link buttons which, when clicked, posts the Web Form back to the server. In this case, the Value property can be used to associate a value for each list item that is passed on to the postback event handler.

To respond to the postback event, specify a handler for the Click event, using the event data of the BulletedListEventArgs class to determine the index of the link button in a BulletedList that the user clicked.

Adding List Items

How items are added to the BulletedList depends on whether the control will display a static list or a list generated dynamically at run time. The list items for a BulletedList control may be defined using any of the following ways:

  1. by adding individual ListItem objects declaratively. For particulars, see Adding BulletedList Items Declaratively.
  2. by programmatically creating new instances of the ListItem class. For particulars, see Adding BulletedList Items Programmatically.
  3. by binding the control to a data source. For particulars, see Binding a BulletedList Control to a Data Source.

See Also

Adding BulletedList Items Declaratively   Adding BulletedList Items Programmatically



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note