BulletedList::DisplayMode Property
Gets or sets the display mode of the list content in a BulletedList control.
Assembly: System.Web (in System.Web.dll)
public: property BulletedListDisplayMode DisplayMode { virtual BulletedListDisplayMode get(); virtual void set(BulletedListDisplayMode value); }
Property Value
Type: System.Web.UI.WebControls::BulletedListDisplayModeOne of the BulletedListDisplayMode values. The default is Text.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The specified type is not one of the BulletedListDisplayMode values. |
Use the DisplayMode property to specify the display behavior to apply to the content of list items in a BulletedList control. The DisplayMode property is set using one of the BulletedListDisplayMode enumeration values. The following table lists the possible values.
Value | Displayed as |
|---|---|
Text. | |
Hyperlinks. | |
Link buttons. |
The HyperLink value allows you to display list 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 field allows you to display list content as links. Use the BulletedList::Click event to post back to the server when a link button is clicked.
The value of this property is stored in view state.
The following code example demonstrates how to create a BulletedList control and set the DisplayMode property. A ListBox control is populated with the BulletedListDisplayMode enumeration values. The format of the list item content changes based on the display mode that the user selects from the list box.
Available since 2.0