ListItem::Selected Property
Gets or sets a value indicating whether the item is selected.
Assembly: System.Web (in System.Web.dll)
Property Value
Type: System::Booleantrue if the item is selected; otherwise, false. The default is false.
The following example demonstrates how to use the Selected property when iterating through the Items collection of a CheckBoxList control to determine which check boxes are selected.
Note |
|---|
The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see ASP.NET Web Forms Page Code Model. |
Available since 1.1
Items
CheckBoxList
ListControl
RadioButtonList
ListBox
DropDownList
CheckBoxList
ListItem Class
System.Web.UI.WebControls Namespace
ListBox Web Server Control Overview
RadioButton and RadioButtonList Web Server Controls Overview
CheckBox and CheckBoxList Web Server Controls Overview
BulletedList Web Server Control Overview
DropDownList Web Server Control Overview
