asp.net.ph

Skip Navigation Links

Binding a BulletedList Control to a Data Source

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


Like other ASP.NET controls which derive from the base ListControl class, such as the ListBox, DropDownList, RadioButtonList, and CheckBoxList controls, the BulletedList control can display items that are dynamically obtained from a data source at run time.

In this case, the list items correspond to the values of a given field in the data source. The control can display one field from the source and can optionally use a second field as the item value.

To populate a BulletedList control from a database

This example shows a BulletedList control that is bound to a SqlDataSource control.

  1. Declare an <asp:BulletedList> element on the page. For syntax, see BulletedList Control Syntax.
  2. Specify the control’s DataSourceID property.
  3. Specify at the very least the required DataTextField. The value of each record in this field will then be displayed as the text of each item in the list.
  4. Optionally set the following control properties:

In the below example, a BulletedList control is used to display the list of employees in the NorthWind Traders database, enabling a user to view the details for a selected employee.

Binding a BulletedList to a Data Source Control
Run Sample | View Source
See Also

Adding BulletedList Items Programmatically   Customizing the BulletedList Control Interface



© 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