System.Web 2.0.0.0 System.Web.UI.WebControls.ListControl System.Web.UI.IPostBackEventHandler System.Web.UI.SupportsEventValidation System.ComponentModel.DefaultProperty("BulletStyle") System.ComponentModel.DefaultEvent("Click") System.ComponentModel.Designer("System.Web.UI.Design.WebControls.BulletedListDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")

In this topic:

Introduction

Accessibility

Declarative Syntax

## Introduction

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 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 property to one of the bullet types that are defined by the enumeration. The following table lists the available bullet styles.

Bullet style

Description

Not set.

A number.

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 property to specify the value that starts the numbering of list items in an ordered control. The value that is assigned to the property is ignored, if the property is set to the , , , or field. If you set the property to the value of to specify a custom image for the bullet, you must set the property also to specify the location of the image file.

To specify the display behavior of the list items in a , set the property to one of the values that are defined by the enumeration. The defined display behaviors are , , and .

When a hyperlink is clicked, it navigates to a URL. Use the property to specify the URL that a hyperlink navigates to. Use the property to specify the frame or window that displays the Web page that is navigated to when a hyperlink is clicked.

When the property is set to , 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 event. Note that the and properties are inherited from the class and are not applicable to the control. Use the event data of the 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.

## Accessibility

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.

## Declarative Syntax

`<asp:BulletedList AccessKey="string" AppendDataBoundItems="True|False" AutoPostBack="True|False" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge| Inset|Outset" BorderWidth="size" BulletImageUrl="uri" BulletStyle="NotSet|Numbered|LowerAlpha|UpperAlpha|LowerRoman| UpperRoman|Disc|Circle|Square|CustomImage" CausesValidation="True|False" CssClass="string" DataMember="string" DataSource="string" DataSourceID="string" DataTextField="string" DataTextFormatString="string" DataValueField="string" DisplayMode="Text|HyperLink|LinkButton" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" FirstBulletNumber="integer" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small| Medium|Large|X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" ID="string" OnClick="Click event handler" OnDataBinding="DataBinding event handler" OnDataBound="DataBound event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnSelectedIndexChanged="SelectedIndexChanged event handler" OnTextChanged="TextChanged event handler" OnUnload="Unload event handler" runat="server" SkinID="string" Style="string" TabIndex="integer" Target="string|_blank|_parent|_search|_self|_top" ToolTip="string" ValidationGroup="string" Visible="True|False" Width="size" > <asp:ListItem Enabled="True|False" Selected="True|False" Text="string" Value="string" /> </asp:BulletedList>`

Creates a control that generates a list of items in a bulleted format.

- Constructor

  Use the constructor to initialize a new instance of the class.

  Initializes a new instance of the class.

  2.0.0.0
- Method
  System.Void ``

  The method is used primarily by control developers to insert the appropriate attributes and styles into the output stream for a control.

  Adds the HTML attributes and styles for a control to render to the specified object.

  An that represents the output stream to render HTML content on the client. 2.0.0.0
- Property
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
  System.ComponentModel.Browsable(false)
  System.Boolean To be added.

  The property is inherited from the class and is not applicable to the control. Do not assign a value to the property. If you do assign a value to the , a exception is thrown.

  Gets or sets the value of the property for the base class.

  2.0.0.0
- Property
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  Use the property to specify the path to an image to display as each bullet in a control. To specify a custom image for the bullets, you must also set the property to the value .

  The control does not support the property because the bullets are inherently decorative and do not provide additional information that needs to be conveyed via assistive technology. However, if you want to use a custom image to convey a concept to the user, you should add additional text to each of the bulleted list items or use a control that allows you to specify alternate text for each image.

  You can specify either a relative or an absolute path to the image. A relative path relates the location of the image to the location of the Web page without specifying a complete path on the server. The path is relative to the location of the Web page. This makes it easier to move the entire site to another directory on the server without updating the code.

  The following code example shows a relative path to an image file:

  [C#]

  `\\Images\\image1.jpg`

  [Visual Basic]

  `"Images\image1.jpg"`

  The following code example shows an absolute path to an image file:

  [C#]

  `"c:\\MyImagesDir\\image1.jpg"`

  [Visual Basic]

  `"c"\MyImagesDir\image1.jpg"`

  The value of this property is stored in view state.

  Gets or sets the path to an image to display for each bullet in a control.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(System.Web.UI.WebControls.BulletStyle.NotSet)
  System.Web.UI.WebControls.BulletStyle To be added.

  Use the property to specify the bullet style to apply to the list items in a control. The property is set using one of the enumeration values. The following table lists the possible values.

  Bullet style

  Description

  Not set.

  A number.

  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.

  Specifying the value allows you to supply your own image for the bullet. If you specify the value, you must also set the property to the URL of the custom image to use.

  The control does not support the property because the bullets are inherently decorative and do not provide additional information that needs to be conveyed via assistive technology. However, if you want to use a custom image to convey a concept to the user, you should add additional text to each of the bulleted list items or use a control that allows you to specify alternate text for each image.

  The value of this property is stored in view state.

  Gets or sets the bullet style for the control.

  2.0.0.0
- Event
  System.Web.UI.WebControls.BulletedListEventHandler

  The event is raised when a list item in a control is clicked. To enable list items in a control to raise the event, the property first must be set to the value .

  Raising an event invokes the event handler through a delegate. For more information about handling events, see Consuming Events.

  Occurs when a link button in a control is clicked.

  2.0.0.0
- Property
  System.Web.UI.ControlCollection To be added.

  The property is inherited from the class and is not applicable to the control. The collection is overridden from the base class to always return the collection.

  Gets a collection for the control.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(System.Web.UI.WebControls.BulletedListDisplayMode.Text)
  System.Web.UI.WebControls.BulletedListDisplayMode To be added.

  Use the property to specify the display behavior to apply to the content of list items in a control. The property is set using one of the enumeration values. The following table lists the possible values.

  Value

  Displayed as

  Text.

  Hyperlinks.

  Link buttons.

  The value allows you to display list content as hyperlinks. When clicked, a hyperlink navigates to a URL. Use the property to specify the URL that a hyperlink navigates to.

  The field allows you to display list content as links. Use the event to post back to the server when a link button is clicked.

  The value of this property is stored in view state.

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

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(1)
  System.Int32 To be added.

  Use the property to specify the value that starts the numbering of list items in an ordered control. The value that is assigned to the property is ignored, if the property is set to the , , , or values. Although the value of the property is an integer, it does not always cause a bullet to render as a number. For example, if you set the property to 4 and set the property to the value , the first bullet number will render as a lowercase d.

  The value of this property is stored in view state.

  Gets or sets the value that starts the numbering of list items in an ordered control.

  2.0.0.0
- Method
  System.Void ``

  The event is raised when a list item in the control is clicked. To enable list items in a control to raise the event, you must first set the property to the value .

  Raising an event invokes the event handler through a delegate. For more information, see Consuming Events.

  The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

  Raises the event for the control.

  A that contains the event data. 2.0.0.0
- Method
  System.Void ``

  The method is used internally by the control when a link button within the item list is clicked. The containing page specifies the index of the clicked link button in the parameter, which is used to initialize the property of a object. The method raises a event by passing the initialized object to the method.

  The method optionally can perform validation before raising the event for the control. To validate a group of controls on the page when a link button within the is clicked, set the property to true and specify the group of controls to be validated in the property.

  Raises events for the control when a form is posted back to the server.

  The string representation for the index of the list item that raised the event. 2.0.0.0
- Method
  2.0.0.0
  System.Void ``

  The method is used primarily by control developers.

  The method writes the rendered content of the items to the client using the supplied object. Each item is represented by an element in the collection.

  If the property of the control is empty, no content is rendered to the . If there is at least one list item in the collection, the method writes the HTML content for the control using the , , and methods.

  Writes the control content to the specified object for display on the client.

  An that represents the output stream to render HTML content on the client.
- Method
  System.Void `` `` ``

  The method renders the bulleted text for each list item in a control using the specified property.

  Renders the bulleted text for each list item in a control.

  A collection of objects in a . The zero-based index of the to retrieve from the collection. The output stream that renders HTML content to the client. 2.0.0.0
- Method
  2.0.0.0
  System.Void ``

  This method renders the list items of a control as bullets into the specified . This method is used primarily by control developers.

  Renders the list items of a control as bullets into the specified .

  An that represents the output stream to render HTML content on the client.
- Property
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
  System.ComponentModel.Bindable(false)
  System.Int32 To be added.

  In the base class, , the property returns a zero-based index of the currently selected item. The default is -1, which indicates that nothing is selected. The property is not applicable to the control.

  Note When you use the get accessor for the property, it always returns -1. An attempt to use the set accessor for the property raises a .

  Use the event data of the class to determine the index of the link button in a control that was clicked.

  This property is not bindable in visual designers, but is bindable at runtime. For more information, see .

  Gets or sets the zero-based index of the currently selected item in a control.

  2.0.0.0
- Property
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
  System.Web.UI.WebControls.ListItem To be added.

  In the base class, , the property returns a object that represents the currently selected item in a control. The default is null. The property is not applicable to the control.

  If you use the get accessor for the property to return the selected item for a control, it always returns null.

  Use the event data of the class to determine the index of the link button in a that was clicked.

  Gets the currently selected item in a control.

  2.0.0.0
- Property
  System.ComponentModel.Bindable(false)
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
  System.String To be added.

  The property is inherited from the class and is not applicable to the control.

  The property is set internally based on the selected list item in the control. If you set the property directly, a exception is thrown.

  This property is not bindable in visual designers, but is bindable at runtime. For more information, see .

  Gets or sets the property of the selected object in the control.

  2.0.0.0
- Method
  2.0.0.0
  System.Void ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  For a description of this method, see .

  A string that represents an optional event argument to pass to the event handler.
- Property
  System.Web.UI.HtmlTextWriterTag To be added.

  Use the property to determine the value that is associated with the control. The property is used primarily by control developers.

  Gets the value for the specified control.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.TargetConverter))
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  Values must begin with a letter in the range of A through Z (case-insensitive), except for the special values that are listed in the following table, which begin with an underscore.

  Value

  Description

  _blank

  Renders the content in a new window without frames.

  _parent

  Renders the content in the immediate frame-set parent.

  _search

  Renders the content in the search pane.

  _self

  Renders the content in the frame with focus.

  _top

  Renders the content in the full window without frames.

  Check your browser documentation to determine if the _search value is supported. For example, Microsoft Internet Explorer 5.0 and later support the _search target value.

  Use the property to specify the frame or window that displays the Web page that is linked to when a hyperlink in a control is clicked. To display the content of the list items as hyperlinks in a control, set the property to the value . Then, set the property of each list item to the URL of the Web page to navigate to.

  If the property is not set, the browser or window with focus refreshes when the hyperlink is clicked.

  The property renders as a target attribute. The target attribute on anchor elements is not allowed in the XHTML 1.1 document type definition. Do not set the property if the rendered output for the must be XHTML 1.1 compliant. For more information, refer to the topic ASP.NET and XHTML Compliance.

  When creating accessible Web pages, it is strongly recommended you avoid using the property to target another window. For more information, see ASP.NET Accessibility.

  The value of this property is stored in view state.

  Gets or sets the target window or frame in which to display the Web page content that is linked to when a hyperlink in a control is clicked.

  2.0.0.0
- Property
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
  System.String To be added.

  The property is inherited from the class and is not applicable to the control.

  The property is set internally based on the selected list item in the control. If you set the property directly, a exception is thrown.

  While you cannot access the property of control, you can use the event data of the class to determine the index of the link button in a that was clicked. You can then access the property of the control.

  Gets or sets the text for the control.

  2.0.0.0