By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,711 Members | 2,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,711 IT Pros & Developers. It's quick & easy.

Viewstate

P: 5
Where the viewstate is stored after the page postback?
Jan 8 '19 #1
Share this Question
Share on Google+
1 Reply


P: 17
View State is the method to preserve the Value of the Page and Controls between round trips. It is a Page-Level State Management technique. View State is turned on by default and normally serializes the data in every control on the page regardless of whether it is actually used during a post-back.
For Example of the login form

After the Submit button is clicked the value of user name and password is submitted to the server. We cannot restore the value again because after the postback the instance of the control is destroyed and on clicking of the Restore Button the server takes a new request and the server cannot restore the value of the TextBox.
After clicking on the Submit Button the value of user name and password is submitted in View State and the View State stores the value of user name and password during post-back.

After click on the Restore Button we can get the value again. The Value must be retained during post-back and the values are stored into a base 64 encoded string and this information is then put into the View State Hidden Field.

Data Objects That Can be Stored in View state
  • String
  • Boolean Value
  • Array Object
  • Array List Object
  • Hash Table
  • Custom type Converters
Attached Images
File Type: png image008.png (7.2 KB, 4 views)
Jul 4 '19 #2

Post your reply

Sign in to post your reply or Sign up for a free account.