asp.net.ph

BulletedList.DisplayMode Property

System.Web.UI.WebControls Namespace   BulletedList Class


.NET Framework version 2.0

Sets or retrieves the display mode of the list content in a BulletedList control.

Syntax


Inline <asp:bulletedlist displaymode = enumValue ... >
Script BulletedList.DisplayMode = [ enumValue ]

Property Value


enumValue One of the BulletedListDisplayMode enum values.

The property is read/write with a default value of Text.

Exceptions


Exception Type Condition
ArgumentException The given mode is not one of the BulletedListDisplayMode values.

Remarks

Use the DisplayMode property to specify the display behavior of the list items in a BulletedList control.

When not specified, DisplayMode defaults to the Text value, which displays the list item content as regular text with no additional functionality.

Setting DisplayMode to HyperLink specifies that the control displays the list content as hyperlinks which, when clicked, navigates to a URL. To specify the URL that a hyperlink navigates to, use the Value property.

Setting DisplayMode to LinkButton specifies that the control displays the list 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.

Example

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.

Adding BulletedList Items Declaratively
Run Sample | View Source
Dynamically Setting the BulletStyle Property of a BulletedList Control
Run Sample | View Source
Binding a BulletedList to a Data Source Control
Run Sample | View Source
See Also

BulletedList Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph