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 Control Reference Manual page.
The following example demonstrates some of the properties of the TextBox control that you might use:
Example
Adding Script
When the form is submitted, the content and settings of the TextBox control may be modified by server-side scripts. The form can be submitted by clicking a button or when the user modifies the value of the TextBox control.
In the following example, 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 will be executed. The submit subroutine will write a line of text to the Label control:
Example
In the following example, we declare a TextBox control and a Label control in the .aspx file. When you modify the value in the TextBox and click outside of it (or press the Tab key), the change subroutine will be executed. The change subroutine will write a line of text to the Label control: