The ViewState field contains information about the state of the controls at the time they were rendered and presented on the page, allowing the ASP.NET runtime to compare and identify changes in the content submitted to the server.
Or
ViewState is required for webforms controls as they need a mechanism to store additional data so that the controls can be recreated on postback. As form elements is included in postbacks, anything on the page that is not a form value is lost. MVC does not support webforms controls, we need to manage all the html rendering and state ourself. ViewState was just a hidden field anyway, and we can still use the same technique for storing data about controls if we need to.
Liked By
Write Answer
What is viewstate in MVC?
Join MindStick Community
You have need login or register for voting of answers or question.
Nishi Tiwari
18-Jan-2020The ViewState field contains information about the state of the controls at the time they were rendered and presented on the page, allowing the ASP.NET runtime to compare and identify changes in the content submitted to the server.
Or
ViewState is required for webforms controls as they need a mechanism to store additional data so that the controls can be recreated on postback. As form elements is included in postbacks, anything on the page that is not a form value is lost. MVC does not support webforms controls, we need to manage all the html rendering and state ourself. ViewState was just a hidden field anyway, and we can still use the same technique for storing data about controls if we need to.