BulletedList.SelectedIndex Property

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

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[BindableAttribute(false)]
public override int SelectedIndex { get; set; }
<asp:BulletedList SelectedIndex="Int32" />

Property Value

Type: System.Int32
Always returns -1.

ExceptionCondition
NotSupportedException

An attempt was made to assign a value to the SelectedIndex.

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

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

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

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

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft