System.Web.UI.WebControls Namespace ListItem Class
Sets or retrieves a value indicating whether the item is selected.
Inline |
<asp:listitem selected = [ true | false ]... > |
Script |
ListItem.Selected = [ true | false ] |
This property accepts or returns only a boolean value: true if the item is selected; otherwise, false. Default value is false.
Use the Selected property to determine whether the ListItem is currently selected in the list control that contains it. This property is commonly used when iterating through a ListItemCollection, to determine whether an item is selected.
The following examples demonstrate using the Selected property to dynamically determine or specify the selected items in a ListControl at run time.
ListItem Members