Easy Tutorial
❮ Prop Webcontrol Listcontrol Datatextfield Prop Webcontrol Calendar Titlestyle ❯

ASP.NET HtmlSelect Control



Definition and Usage

The HtmlSelect control is used to control the <select> element. In HTML, the <select> element is used to create a dropdown list.


Properties

Property Description
Attributes Returns all attribute name and value pairs of the element.
DataMember The name of the data table to use.
DataSource The data source to use.
DataTextField The field from the data source to display in this dropdown list.
DataValueField The field from the data source that specifies the value of each option in the dropdown list.
Disabled A Boolean value indicating whether the control is disabled. Default is false.
id The unique ID of the control.
InnerHtml Sets or returns the content between the start and end tags of the HTML element. Special characters are not automatically converted to HTML entities.
InnerText Sets or returns all text between the start and end tags of the HTML element. Special characters are automatically converted to HTML entities.
Items The list of items in the dropdown list.
Multiple Whether multiple items can be selected simultaneously.
OnServerChange The name of the function to be executed when the selected item is changed.
runat Specifies that the control is a server control. Must be set to "server".
SelectedIndex The index number of the currently selected item.
Size The number of visible items in the dropdown list.
Style Sets or returns the CSS properties applied to the control.
TagName Returns the tag name of the element.
Value The value of the currently selected item.
Visible A Boolean value indicating whether the control is visible.

Example

HTMLSelect

❮ Prop Webcontrol Listcontrol Datatextfield Prop Webcontrol Calendar Titlestyle ❯