Gets or sets the ordinal index of the selected option item in an HtmlSelect control. If multiple items are selected, this property holds the index of the first item selected in the list.
[Visual Basic] Overridable Public Property SelectedIndex As Integer [C#] public int SelectedIndex {virtual get; virtual set;} [C++] public: __property virtual int get_SelectedIndex(); public: __property virtual void set_SelectedIndex(int); [JScript] public function get SelectedIndex() : int; public function set SelectedIndex(int);
The ordinal index of the selected item.
For lists with the Multiple property set to true, a value of-1 indicates that no items are selected.
For lists with the Multiple property set to false, an item is always selected.
HtmlSelect Class | HtmlSelect Members | System.Web.UI.HtmlControls Namespace