JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the HtmlSelect Class

This class gives you access to HTML <select> elements in server code. Here is the inheritance hierarchy of this class:

Object
   Control
      HtmlControl
         HtmlContainerControl
            HtmlSelect

You can find the notable public properties of HtmlSelect objects in Table 19.18 and their events in Table 19.19. (This class has no non-inherited methods.) Note that as with other HTML server controls, I am not listing the notable properties, methods, and events this class inherits from the Control class; you can find them in Tables 15.1 to 15.3 in Chapter 15. This class also inherits the HtmlControl class—you can find that class in Table 19.2—and the HtmlContainerControl class, which you see in Table 19.3.

Table 19.18: Noteworthy public properties of HtmlSelect objects.

Property

Means

Items

Gets the list of option elements in the select control.

Multiple

Gets/sets whether multiple option elements can be selected at once.

SelectedIndex

Gets/sets the index of the selected option element.

Size

Gets/sets the number of option elements visible at one time. Note that if you set this to a value of more than one, browsers will usually show a scrolling list.

Value

Gets/sets the item selected in the select control.

Table 19.19: Noteworthy public events of HtmlSelect objects.

Event

Means

ServerChange

Occurs when a select control is changed. Handle this event on the server.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor