Subject not found.
1.

What Is A Viewstate?

Answer»

In classic ASP, when a form is submitted the form values are cleared. In some cases the form is submitted with huge information. In such cases if the server comes back with error, one has to re-enter correct information in the form. But submitting clears up all form values. This happens as the site does not MAINTAIN any state (ViewState).

In ASP.NET, when the form is submitted the form reappears in the browser with all form values. This is because ASP.NET MAINTAINS your ViewState. ViewState is a state management technique built in ASP.NET. Its purpose is to keep the state of controls during subsequent postbacks by the same user. 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 <form runat="server"> control.

<INPUT type="hidden" name= "_VIEWSTATE" value="dDwyNTA 3OTU0NDM7Oz 7t5Tntzk OUeB0QVV6FT2hvQwtp" Pw =="/>

If you want to NOT maintain the ViewState, include the directive <%@ Page Enable VIEW State="false"%> at the top of an .aspx page If you do not want to maintain Viewstate for any control add the attribute Enable View State="false" to any control.

In classic ASP, when a form is submitted the form values are cleared. In some cases the form is submitted with huge information. In such cases if the server comes back with error, one has to re-enter correct information in the form. But submitting clears up all form values. This happens as the site does not maintain any state (ViewState).

In ASP.NET, when the form is submitted the form reappears in the browser with all form values. This is because ASP.NET maintains your ViewState. ViewState is a state management technique built in ASP.NET. Its purpose is to keep the state of controls during subsequent postbacks by the same user. 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 <form runat="server"> control.

<input type="hidden" name= "_VIEWSTATE" value="dDwyNTA 3OTU0NDM7Oz 7t5Tntzk OUeB0QVV6FT2hvQwtp" Pw =="/>

If you want to NOT maintain the ViewState, include the directive <%@ Page Enable View State="false"%> at the top of an .aspx page If you do not want to maintain Viewstate for any control add the attribute Enable View State="false" to any control.



Discussion

No Comment Found