. Net Getting Started Tutorial: ASP. NET web page forms

Source: Internet
Author: User

. Net Getting Started Tutorial: ASP. NET web page forms

All Server controls must appear in a <form> tag, and the <form> tag must contain the runat = "server" attribute.
 

ASP. NET Web forms
All Server controls must appear in a <form> tag, and the <form> tag must contain the runat = "server" attribute. The runat = "server" attribute indicates that the form should be processed on the server. The report also states that the attached control can be implemented through the server script:

<Form runat = "server">
... HTML + server controls
</Form>

Note: The table is always submitted to the webpage. If you specify the action attribute, this cannot be ignored.

If you omit the attribute method, it will be set to the method = "after" default. In addition,

If you do not specify the name and number attributes, they will automatically assign ASP. NET.

Note :. The aspx page can only contain one <form runat = "server"> control!

If you select to view the source. The aspx page contains a form with no name, method, action,

You can see that ASP. NET adds these attributes. It looks like this:

 

<Form name = "_ ctl0" method = "post" action = "page. aspx" id = "_ ctl0">
... Some code
</Form>

 

 

Submit form
Click the button most frequently when submitting a form. The format of server control buttons in ASP. NET is as follows:

<Asp: Button id = "id" text = "label" OnClick = "sub" runat = "server"/>

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.