Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please briefly describe me what is basic importance of view state?
Posted

If you are totally new to any topic, please do search for online help (may be searching on google) and then if you get across any doubt or unclear area, post your queries/ questions...

For understanding ViewState, please refer : http://msdn.microsoft.com/en-us/library/ms972976.aspx
 
Share this answer
 
Quote:
View state is the method that the ASP.NET page framework uses to preserve page and control values between round trips. When the HTML markup for the page is rendered, the current state of the page and values that must be retained during postback are serialized into base64-encoded strings. This information is then put into the view state hidden field or fields.


For more info : ASP.NET View State Overview

More links : Understanding ASP.NET View State

I hope this will help to you.
 
Share this answer
 
v2
Hi,

Thanks for asking this question since I had a chance to dig little further about ViewState,
You can find your answer here[^]
Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
When a form is submitted in classic ASP, all form values are cleared. Suppose you have submitted a form with a lot of information and the server comes back with an error. You will have to go back to the form and correct the information. You click the back button, and what happens.......ALL form values are CLEARED, and you will have to start all over again! The site did not maintain your ViewState.

When a form is submitted in ASP .NET, the form reappears in the browser window together with all form values. How come? This is because ASP .NET maintains your ViewState. 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.
 
Share this answer
 
v2
Please have a look at this PDF
short and simple.

http://www.mainebytes.org/download/viewstate.pdf[^]
 
Share this answer
 
Viewstate helps you retain controls data across postbacks. As http is stateless protocol.
Viewstate is .net way of retaining data.
Viewstate is base64 encoded and is stored in hidden variable which is sent to and forth with page. EnableViewstateMAC property of page helps view state from being tampered.
Viewstate can disabled at control level, page level and application level(In web.config)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900