top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the concept of view state in ASP.NET?

0 votes
466 views
What is the concept of view state in ASP.NET?
posted Sep 1, 2015 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

View state provides state information for a specific ASP.NET page. If you need to use information on more than one page, or if you need the information to persist across visits to the Web site, you must use another method for maintaining state.

answer Sep 1, 2015 by Shivaranjini
0 votes

View state is one of the feature of Client side State Management technique under the ASP.Net State Management. It is a way to preserve the value of the page and controls between round trips.
Suppose you have a webform with two text fields namely user name and password along with 2 button namely submit and restore.
In the above case if we dont use view state than, 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 instance, the control is destroyed and upon clicking of the restore Button the server takes a new request and the server cannot restore the value of the TextBox.
BUT if we use view state than, 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 and upon clicking on the restore button we can get the value again.

answer Nov 28, 2016 by Akhilesh Kumar Das
Similar Questions
+3 votes

Hai, friends anybody say about the different levels of State management in ASP.NET

...