---
title: "What is the function of the ViewState property?"  
description: "What is the function of the ViewState property?"  
author: "Sumit Kesarwani"  
published: 2014-08-24  
updated: 2020-09-22  
canonical: https://www.mindstick.com/interview/2002/what-is-the-function-of-the-viewstate-property  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# What is the function of the ViewState property?

The ASP.NET 4.0 introduced a new property called ViewStateMode for the Control class. Now you can enable the view state to an individual control even if the view state for an ASP.NET page is disabled.

## Answers

### Answer by Amir Masood

\
ViewState is used to maintain the state of controls during page postback and if we save any control values or anything in viewstate we can access those values throughout the page whenever it required

### Answer by Sumit Kesarwani

The ASP.NET 4.0 introduced a new property called ViewStateMode for the Control class. Now you can enable the view state to an individual control even if the view state for an ASP.NET page is disabled.


---

Original Source: https://www.mindstick.com/interview/2002/what-is-the-function-of-the-viewstate-property

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
