Where the viewstate is stored after the page postback?
9 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Sanwar RanwaRank #23 · 44.7K reputationPosted Dec 21, 2018, 5:01 PM EST
+3
Hello Vaibhav
ViewState is stored in a hidden field on the page at client side.ViewState is transported to the client and back to the server and not stored on the server
+3
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 21, 2018, 11:22 PM EST
+2
Hi Vaibhav,
Please find below link which will explain view state usage and storage
Please find below example where it will store value of viewstate. Once page is load then just right click and click on view Page source. You able to find view state value in source page in encode format
Vaibhav Kapoor51 reputationPosted Dec 23, 2018, 5:15 PM EST
+2
Thank you for this valuable suggestion
+2
Jignesh KumarRank #91 · 22.9K reputationPosted Aug 3, 2020, 6:20 AM EDT
+2
Viewstate is used to retain control's value during postback. Viewstate values are stored in hidden filed in encoded form.
+2
Laxmidhar SahooRank #383 · 6.6K reputationPosted Aug 3, 2020, 6:49 AM EDT
+2
hi
The view state is a key element of an ASP.NET page because it is the primary means to persist the state of the Web server controls. Whenever the page posts back, the state is restored, updated using the current form parameters, then used to run the postback event handler. Normally, the view state is a hashed string encoded as Base64 and stored in a hidden field called __VIEWSTATE. In this way, the view state is not cached on the client, but simply transported back and forth with potential issues both for security and performance. As I said, you could keep the view state on the server, which requires only minimal coding. You will pay extra overhead because you're accessing a file off the disk or a database, but you'll be returning much slimmer pages while taking less of a security risk. Although in this column I considered persistent storage on the server (file or database), nothing would really prevent you from using the Cache object, thus combining server-side storage and speed of execution.
Yogeshkumar HadiyaRank #358 · 7K reputationPosted Jan 9, 2021, 11:01 AM EST
+2
View State Information stores in hidden fields. Information travels between server and client in this hidden fields.
In Asp.Net by default .net implements view state for all its control, thats why a textbox value does not lost when we click on a button of that page.
+2
Mageshwaran RRank #411 · 6.1K reputationPosted Jan 12, 2021, 3:52 AM EST
+1
Hi Kapoor,
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.
Sanwar RanwaRank #23 · 44.7K reputationPosted Dec 21, 2018, 5:01 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 21, 2018, 11:22 PM EST
Vaibhav Kapoor51 reputationPosted Dec 23, 2018, 5:15 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Aug 3, 2020, 6:20 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Aug 3, 2020, 6:49 AM EDT
Yogeshkumar HadiyaRank #358 · 7K reputationPosted Jan 9, 2021, 11:01 AM EST
Mageshwaran RRank #411 · 6.1K reputationPosted Jan 12, 2021, 3:52 AM EST
arjeet mehta4 reputationPosted Aug 2, 2020, 8:09 PM EDT
Navaneeth KrishnanRank #1,172 · 1.5K reputationPosted Aug 4, 2020, 4:48 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts