To take full advantage of the ASP.NET framework, you should not create HTML forms that post to a separate page. If a form posts to another page, any view state maintained by the page is lost. In ASP Classic, it is very common to have a form that posts data to a second page, as illustrated in Figure A.1. Figure A.1. Posting to a new page.
The preferred method for working with forms in the ASP.NET framework is to post forms back to the same page. Posting a form back to itself is called a postback . Performing a postback is illustrated in Figure A.2. Figure A.2. Performing a postback.
When you have a form post back to itself, you can take advantage of view state (property values of controls are automatically preserved between posts). After you perform a postback, you can use the Response.Redirect method to send a user to a new page. |