System.Web.UI.WebControls Namespace
.NET Framework version 2.0
Specifies the display behaviors you can apply to the list item contents in a BulletedList control.
Member Name |
Description |
HyperLink |
Displays the list item content as hyperlinks. |
LinkButton |
Displays the list item content as link buttons. |
Text |
Displays the list item content as text. |
The BulletedListDisplayMode enumeration represents the display behaviors that you can apply to the content of the list items in a BulletedList control.
The DisplayMode property uses these enumeration values to set the display behavior of the list item content in a BulletedList control.
When not specified, BulletedListDisplayMode defaults to the Text value, which displays the list item content as regular text with no additional functionality.
The HyperLink value displays list item content as hyperlinks which, when clicked, navigates to a URL. To specify the URL that a hyperlink navigates to, use the Value property.
The LinkButton value displays list item content as link buttons which, when clicked, posts the Web Form back to the server. In this case, the Value property can be used to associate a value for each list item that is passed on to the postback event handler.
To respond to the postback event, specify a handler for the Click event, using the event data of the BulletedListEventArgs class to determine the index of the link button in a BulletedList that the user clicked.
The following example shows how to declaratively set the DisplayMode property of a BulletedList control at design time.
<asp:bulletedlist id = "bulletedList" runat = "server"
bulletstyle = "disc"
displaymode = "hyperlink"
target = "_blank">
<asp:listitem value = "http://www.microsoft.com">Microsoft</asp:listitem>
<asp:listitem value = "http://www.asp.net">ASP.NET</asp:listitem>
<asp:listitem value = "http://msdn.microsoft.com">MSDN</asp:listitem>
</asp:bulletedlist>
The following examples demonstrate using the DisplayMode property to specify the different display behaviors that can be applied to list items in a BulletedList control.
BulletedList Class