BulletedList::DisplayMode Property

 

Gets or sets the display mode of the list content in a BulletedList control.

Namespace:   System.Web.UI.WebControls
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::BulletedListDisplayMode

One 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

Text.

HyperLink

Hyperlinks.

LinkButton

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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: