ASP.NET Web Forms - TextBox Control
The TextBox control is used to create a text box where users can enter text.
TextBox Control
The TextBox control is used to create a text box where users can enter text.
The features and properties of the TextBox control are listed on our WebForms Controls Reference Manual page。
The example below demonstrates some properties of the TextBox control that you may use:
Example
Demo Example »
Add Script
When a form is submitted, the content and settings of the TextBox control may be modified by server scripts. The form can be submitted by clicking a button or when the user modifies the value of the TextBox control.
In the example below, we declare a TextBox control, a Button control, and a Label control in the .aspx file. When the submit button is triggered, the submit subroutine is executed. The submit subroutine writes a line of text into the Label control:
Example
Demo Example »
In the example below, we declare a TextBox control and a Label control in the .aspx file. When you modify the value in the TextBox and click outside the TextBox (or press the Tab key), the change subroutine is executed. The change subroutine writes a line of text into the Label control:
Example
Demo Example »