May 12, 2021 ASP.NET
All server controls must appear in the "lt;form" tag, which must contain the runat"server" property.
All server controls must appear in the label, which must contain the runat"server" property. T he runat-"server" property indicates that the form must be processed on the server. It also indicates that the controls contained inside it can be accessed by the server script:
Note: The form is always submitted to its own page. I f you specify an action property, it is ignored. I f you omit the method property, it will default to the method "post". Also, if you don't specify the name and id properties, they are automatically ASP.NET by the file.
Note: A .aspx page can contain only one control, the "server"!
If you choose to view the source code on a .aspx page that contains a form that does not contain name, method, action, or id properties, you'll see ASP.NET add these properties to the form, as follows:
Forms are usually submitted at the click of a button. ASP.NET the Button server controls in the system are as follows:
The id property defines a unique name for the button, and the text property assigns a label to the button. The onClick event handle specifies a named sub-routine to execute.
In the following example, we .aspx button control in the file. Click the button to run a sub-routine that changes the text on the button: