Chapter 4. Working with the Page

 

Whatever you do will be insignificant, but it is very important that you do it.

 
 --Mahatma Gandhi

Although formless pages are still accepted and correctly handled, the typical ASP.NET page is a single form page. The HtmlForm class defines the behavior of the server-side form when the runat attribute is set to server. The HtmlForm class acts as a container of server controls and wraps them in an HTML <form> element when the page is rendered. The obtained HTML form always posts to the same page and for this reason is said to be reentrant. The default method used to submit form data is POST but GET can be used as well.

In most cases, the server form is the outermost tag and is contained directly in <body>. In general, ...

Get Programming Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.