How to: Add BulletedList Web Server Controls to a Web Forms Page
The BulletedList control can display static text in a list that is either unordered (bulleted) or ordered (numbered).
To add a BulletedList Web server control to a Web Forms page
Add an
<asp:BulletedList>
element to the page.Set the BulletedList control's DisplayMode property to one of the following values to specify how the control displays list items:
Text Items are displayed as plain text.
HyperLink Items are displayed as hyperlinks.
LinkButton Items are displayed as link buttons.
Add list items to the control in one of the following ways:
Add individual items. For details, see How to: Add Items in List Web Server Controls.
Bind data to the control. For details, see How to: Populate List Web Server Controls from a Data Source.
Note If you have set the DisplayMode property to HyperLink, specify the target URLs of the hyperlinks in each item's Value property.
Set the BulletStyle property to specify whether the control displays items as bullets or as numbers. To create a numbered, or ordered, list, set the property to one of the following enumeration values:
LowerRoman
To create a bulleted, or unordered, list, set the property to one of the following values:
To display bullets as custom images, set the BulletStyle property to the URL of a graphic. The same graphic is displayed for each item.
Example
The example shows a BulletedList control that is configured to display the list items as hyperlinks. The control contains statically defined items in which the URLs of the hyperlinks are defined in the Value property of each item. The control is also configured to display a custom image as the bullet.
<asp:BulletedList
BulletImageUrl="~/Images/bullet1.JPG"
BulletStyle="CustomImage"
DisplayMode="HyperLink"
ID="BulletedList1"
runat="server">
<asp:ListItem
Value="https://www.contoso.com/">Contoso</asp:ListItem>
<asp:ListItem
Value="https://www.asp.net/">ASP.NET</asp:ListItem>
</asp:BulletedList>