ASP. NET TextBox control

Source: Internet
Author: User

ASP. NET TextBox control

The TextBox control is used to create a text box. You can enter text.

TextBox control
The TextBox control is used to create a text box. You can enter text.

The network control reference page lists the properties and properties of the TextBox control.

The following example shows some TextBox controls that you can use for attributes:

For example

A TextBox with text:
<Asp: TextBox id = "tb4" Text = "Hello World! "Runat =" server "/>
<Br/>

A multiline TextBox:
<Asp: TextBox id = "Int32" TextMode = "multiline" runat = "server"/>
<Br/>

A TextBox with height:
<Asp: TextBox id = "tb6" rows = "5" TextMode = "multiline"
Runat = "server"/>
<Br/>

Add script
A TextBox control for content and settings can be submitted in the form of a server script. Form submission can be done by clicking a button or when the user changes the value of the TextBox control.

In the following example, we declare a TextBox control, a Button control, and a Label control. Aspx file. When the submit button is triggered, submit the subprogram for execution. Submit the sub-program to write a text label control:

<Script runat = "server"> Sub submit (sender As Object, e As EventArgs) lbl1.Text = "Your name is" & txt1.TextEnd Sub </script>
<Html> <body>
<Form runat = "server"> Enter your name: <asp: TextBox id = "txt1" runat = "server"/> <asp: button OnClick = "submit" Text = "Submit" runat = "server"/> <p> <asp: label id = "lbl1" runat = "server"/> </p> </form>
</Body> 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.