JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the TextBox Class

We've already used the System.Web.UI.WebControls.TextBox class quite a bit; this class displays a text box in a Web form. Here is the hierarchy of this class:

Object
   Control
      WebControl
         TextBox

You can find the notable public properties of TextBox objects in Table 15.8 and the notable events in Table 15.9. (Note there's no table of methods here—TextBox inherits all its methods from the WebControl class.) Note that as with other Web server controls, I am not listing the notable properties, methods, and events this class inherits from the Control and WebControl classes—you can find them in Tables 15.1 to 15.5.

Table 15.8: Noteworthy public properties of TextBox objects.

Property

Means

AutoPostBack

Gets/sets whether events will be automatically posted back to the server.

Columns

Gets/sets the text box's width in characters.

MaxLength

Gets/sets the maximum number of characters that may be displayed in the text box.

ReadOnly

Gets/sets whether the text box is read-only.

Rows

Gets/sets a multiline text box's display height.

Text

Gets/sets the text in a text box.

TextMode

Gets/sets whether a text box should be single line, multiline, or a password control.

Wrap

Gets/sets whether text wraps in the text box.

Table 15.9: Noteworthy public events of TextBox objects.

Event

Means

TextChanged

Occurs when the text in the text box is changed.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor