System.Web.UI.HtmlControls Namespace HtmlSelect Class
Sets or retrieves a value indicating whether multiple selection is enabled in the HtmlSelect control.
Inline |
<select multiple ... > |
Script |
HtmlSelect.Multiple = [ true | false ] |
This property accepts or returns only a boolean value: true if multiple selection is enabled on the HtmlSelect control; otherwise false. The default is false.
Use the Multiple property to specify whether multiple items can be concurrently selected in the HtmlSelect control.
By default, HtmlSelect displays as a drop-down list box. If you enable multiple selections, or specify a size that is greater than one and less than the number of items in the control, the control renders as a scrollable list box.
To determine multiple selected items, you need to iterate through the Items collection and test the ListItem.Selected property of each option item.
The following example demonstrates how to programmatically enable multiple selection in the HtmlSelect control, and how the selected items can be determined.
Show me
HtmlSelect Members