asp.net.ph

HtmlSelect.Items Property

System.Web.UI.HtmlControls Namespace   HtmlSelect Class


Returns the collection of option items in an HtmlSelect control.

Syntax


Script HtmlSelect.Items. [ propertyName | methodName ]

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value

A ListItemCollection object that contains the list of options items.

The property is read/write with no default value.

Remarks

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.

Example

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 

See Also

HtmlSelect Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph