ASP. NET Web Forms-TextBox Control, formstextbox
ASP. NET Web Forms-TextBox Control.
The TextBox Control is used to create a TextBox that allows users to enter text.
TextBox Control
The TextBox Control is used to create a TextBox that allows users to enter text.
The properties and properties of the TextBox Control are listed on the WebForms control reference manual page.
The following example demonstrates some properties of the TextBox Control that you may use:
Instance
A basic TextBox:
A password TextBox:
A TextBox with text:
A multiline TextBox:
A TextBox with height:
Runat = "server"/>
A TextBox with width:
Add script
When a form is submitted, the content and settings of the TextBox control may be modified by the server script. The form can be submitted by clicking a button or when the user modifies the value of the TextBox Control.
In the following example, A TextBox Control, a Button control, and a Label control are declared in the. aspx file. When the submit button is triggered, the submit subroutine is executed. The submit subroutine writes a line of text to the Label control:
Instance
Enter your name:
In the following example, we declare a TextBox Control and a Label control in the. aspx file. When you modify the value in TextBox and click (or press the Tab key) outside the TextBox, the change subroutine will be executed. The change subroutine writes a line of text to the Label control:
Instance
Enter your name:
Text = "Hello World! "
Ontextchanged = "change" autopostback = "true"/>