Allows programmatic access to the HTML <select
> element on the server.
The HtmlSelect control <select runat=server
> provides a drop-down list from which users can select an item.
<select
> is always used with a set of <option
> elements, that define the selectable options in the list. The options can be set declaratively at design-time or dynamically at run-time.
When a form containing a selection list is submitted for processing, the control name is provided by the <select
> and the value provided by the selected <option
> element.
If the <option
> explicitly specifies a value attribute, that value is sent. Otherwise, the text that follows the <option
> tag is used as its value. Only the selected option value(s) are submitted to the server.
The following sample illustrates using the HtmlSelect control.
HtmlSelect Control Syntax DropDownList Web Server Control HTML SELECT Element