System.Web.UI.WebControls Namespace ListBox Class
Sets or retrieves a value indicating whether one or more items can be selected in a ListBox control.
Inline |
<asp:listbox selectionmode = enumValue ... > |
Script |
ListBox.SelectionMode = [ enumValue ] |
The property is read/write with a default value of Single.
Use the SelectionMode property specify the mode behavior of the ListBox control ( whether one or more items can be concurrently selected ).
By default, only a single item can be selected. Setting this property to ListSelectionMode.Multiple specifies that more than one item can be selected.
To determine multiple selected items, you need to loop through the ListBox.Items collection and test the Selected property of each item.
The following examples demonstrate using the SelectionMode property of a ListBox control, and how multiple selected items can be determined.
ListBox Members