System.Web.UI.HtmlControls Namespace HtmlSelect Class
Returns the collection of option items in an HtmlSelect control.
Script |
HtmlSelect.Items. [ propertyName | methodName ] |
This property can only be used programmatically; it cannot be set when declaring the control.
A ListItemCollection object that contains the list of options items.
The property is read/write with no default value.
Use the Items collection to manage the list of items in the HtmlSelect control. Like any ASP.NET collection, you can dynamically add items to or remove items from the collection.
When multiple selection is enabled, you can determine which items are selected by looping through the collection.
The following example demonstrates using the Items collection to dynamically add option elements to an HtmlSelect control at run time, depending on user input.
Show me
HtmlSelect Members