. 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"/>