Prabhu Raja
What is a ViewState?
Posted by Prabhu Raja in .Net | ASP.NET on Nov 19, 2011
0
Do you know the answer for this question? Post it below.
Guest

  1. If a site happens to not maintain a ViewState, then if a user has entered some information in a large form with many input fields and the page is refreshes, then the values filled up in the form are lost.
  2. The same situation can also occur on submitting the form. If the validations return an error, the user has to refill the form.
  3. Thus, submitting a form clears up all form values as the site does not maintain any state called ViewState.
  4. In ASP .NET, the ViewState of a form is maintained with a built-in state management technique keeps the state of the controls during subsequent postbacks by a particular user.
  5. The ViewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a control. 
  6. The ViewState option can be disabled by including the directive <%@ Page EnableViewState="false"%> at the top of an .aspx page
  7. If a ViewState of a certain control has to be disabled, then set EnableViewState="false".

Posted by Prabhu Raja on Nov 19, 2011
Sponsored by
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
Sponsored by
Nevron Gauge for SharePoint
Become a Sponsor
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | REPORT ABUSE © 2011 C# Corner. All contents are copyright of their authors.