HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
All server controls must appear in the <form> tag, <form> tag must contain the runat = "server" attribute.
All server controls must appear in the <form> tag, <form> tag must contain the runat = "server" attribute. runat = "server" attribute indicates that the form must be processed on the server. It also shows that the controls contained within it can be accessed by the server script:
Note: This form is always submitted to the page itself.If you specify an action attribute, it will be ignored. If you omit the metion property, it will default method = "post". Also, if you do not specify the name and id attributes, they are automatically assigned by ASP.NET.
Note: An x page can only contain one <form runat = "server"> control!
If you are in a contained with no name, method, action, or id attribute of the form x page, choose to view the source code, you'll see ASP.NET add these attributes to the form, as shown below:
Form is usually submitted by clicking a button. Format ASP.NET Button server control is as follows:
id attribute for the button defines a unique name, text attributes assigned a label for the button. onClick event handler specifies to execute a named subroutine.
In the following example, we declare a Button control in an x file. Click the button to run the subroutine change the text on the button: