All server controls always appear within a <form>
and tag the <form> tag must contain the runat="server"
attribute.
A D V E R T I S E M E N T
ASP.NET Web Forms
All server controls must appear within 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 and it also indicates that the
enclosed controls can be accessed by server scripts
<form runat="server">
..HTML + server controls
</form>
Note: The form is always submitted to the page itself and if you specify an action attribute, it is ignored. If you omit the method attribute,it will be set to method="post" by default. Also,they are automatically assigned by ASP.NET,if you do not specify the name and id attributes.
Note: An .aspx page can only contain ONE <form runat="server">control!
You will see that ASP.NET has added these attributes to the form,if you select view source in an .aspx page containing a form with no name, method, action, or id attribute specified. It looks something like this:
The id attribute defines a unique name for the button and the text attribute assigns a label to the button and the onClick event handler specifies a named subroutine to execute.
In an .aspx file,in the following example we declare a Button control. A button click runs a subroutine which can change the text on the button:
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords:
ASP.NET Web Forms,
asp net web form,
asp net web forms,
web forms in asp net,
asp net 2.0 web form,
php web forms,
html forms,
creating web forms,
email web forms,
create web forms,
database web forms,
javascript forms,
dynamic web forms,
microsoft web forms,
tax forms,
asp net web application,
evaluation forms,
builder forms,
document forms,
forms tutorial,
asp net web applications,
text forms,
template forms,
button forms