Chapter 9. ASP.NET Input Forms

It’s not enough that we do our best; sometimes we have to do what’s required.

Winston Churchill

Although formless pages are still accepted and correctly handled, the typical ASP.NET Web Forms page contains a single <form> tag decorated with the runat attribute set to server. During server-side processing, such a <form> tag is mapped to an instance of the HtmlForm class. The HtmlForm class acts as the outermost container of all server controls and wraps them in a plain HTML <form> element when the page is rendered. The resulting HTML form posts to the same page URL. By design, it doesn’t give you any chance to set the action URL programmatically, and for this reason it is often said to be reentrant. The default method ...

Get Programming Microsoft® ASP.NET 4 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.