System.Web.UI.HtmlControls Namespace HtmlSelect Class
Sets or retrieves the height of the HtmlSelect control.
Inline |
<select size = intRows ... > |
Script |
HtmlSelect.Size [ = intRows ] |
intRows |
Integer specifying the height, in rows, of the HtmlSelect control. |
The property is read/write with no default value.
Use the Size property to specify the height in rows of the HtmlSelect control. This sets the number of options visible in the select box at a time.
By default, HtmlSelect displays as a drop-down list box. If you enable multiple selections, or specify a size that is greater than one and less than the number of items in the control, the control renders as a scrollable list box.
The below code shows how to declaratively set the Size property of an HtmlSelect control at design time.
<select id="mySelect" size=3 runat="server">
<option>Earth</option>
...
<option>Venus</option>
</select>
The following shows how to programmatically set the Size property at run time, depending on user input.
Show me
HtmlSelect Members