The TextBox control represents a customizable text input control.
Use the TextBox.Text or TextBox.Value properties to get or set the control's text.
The TextBox control can represent either a single or multiline text input control depending on the value of the Rows property.
By using the MaxLength property you can specify the maximum number of chars allowed and by setting the AllowEmptyInput property you can define whether or not empty string values are considered valid for the control.
Adjust the interaction with the control by setting the SubmitOnEnter and AutoPostBack properties according to your needs.
By setting the EmptyText property you can display a hint to the user, and by setting the Label and LabelPosition properties you can specify a caption for the control.
The following events are exposed by the TextBox class.
Event | Event arguments | Description |
---|---|---|
ValueChangedEventArgs<String> | Raised when the control's value has changed. |
You can access the control on the client side by its ClientID.
JavaScript
![]() |
---|
var textBox = $find("TextBox1"); |
Use the get_text and set_text or get_value and set_value methods to get or set the control's text.
JavaScript
![]() |
---|
textBox.set_text('test'); |
The following client-side events are exposed by the TextBox class.
Event | Event arguments | Script property | Description |
---|---|---|---|
Raised when a control's value is about to be changed. | |||
Raised when a control's value has changed. | |||
Raised when the control's value is validating. | |||
Raised when the date input is invalid. | |||
Raised when the validation state of the control changes. | |||
- | Raised just after the control has finished loading and is ready for interaction. |