Creates a control that generates a list of items in a bulleted format.
Assembly: System.Web (in System.Web.dll)
[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)] [AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class BulletedList : public ListControl, IPostBackEventHandler
Use the control to create a list of items that are formatted with bullets. To specify the individual list items that you want to appear in a control, place a ListItem object for each entry between the opening and closing tags of the control.
To specify the bullet type to use to display list items in a control, set the BulletStyle property to one of the bullet types that are defined by the BulletStyle enumeration. The following table lists the available bullet styles.
A lowercase letter.
An uppercase letter.
A lowercase Roman numeral.
An uppercase Roman numeral.
A filled circle.
An empty circle.
A filled square.
A custom image.
Use the FirstBulletNumber property to specify the value that starts the numbering of list items in an ordered control. The value that is assigned to the FirstBulletNumber property is ignored, if the BulletStyle property is set to the Disc, Square, Circle, or CustomImage field. If you set the BulletStyle property to the value of CustomImage to specify a custom image for the bullet, you must set the BulletImageUrl property also to specify the location of the image file.
To specify the display behavior of the list items in a , set the DisplayMode property to one of the values that are defined by the BulletedListDisplayMode enumeration. The defined display behaviors are Text, HyperLink, and LinkButton.
When a hyperlink is clicked, it navigates to a URL. Use the Value property to specify the URL that a hyperlink navigates to. Use the Target property to specify the frame or window that displays the Web page that is navigated to when a hyperlink is clicked.
When the DisplayMode property is set to LinkButton, the control displays list items as links that post back to the server when clicked. To programmatically control the actions that are performed when a link button is clicked, provide an event handler for the Click event. Note that the SelectedIndex and SelectedItem properties are inherited from the ListControl class and are not applicable to the control. Use the event data of the BulletedListEventArgs class to determine the index of the link button in a that was clicked.
The control also supports data binding. To bind the to a data source, you can use any of the provided data-binding mechanisms. For more information, see Binding to Databases.
The markup rendered by default for this control might not conform to accessibility standards such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see ASP.NET Controls and Accessibility.
This section contains two code examples. The first code example demonstrates how to create a control with list items that are formatted as link buttons. The second code example demonstrates how to create a control using data binding to specify the list items.
The following code example demonstrates how to create a control with list items that are formatted as link buttons. Text is displayed in a Label control when a list item is clicked.
The following code example demonstrates how to create a control using data binding to specify the list items. The list items are formatted as link buttons. Text is displayed in a Label control when a list item is clicked.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.