asp.net.ph

Skip Navigation LinksHome > ASP.NET Web Forms > Web Forms Server Controls > Controls You Can Use on Web Forms > ASP.NET HTML WebControls

ASP.NET HTML Controls

  Section Index


HtmlSelect Server Control

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 Example
Run Sample | View Source
See Also

HtmlSelect Control Syntax   DropDownList Web Server Control   HTML SELECT Element

More ...
Back to top


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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