---
title: "ViewState in ASP.Net"  
description: "The basic idea behind the view state feature is that when a form is submitted in ASP .NET, the form reappears in the browser window together with all"  
author: "Anonymous User"  
published: 2012-09-11  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/368/viewstate-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# ViewState in ASP.Net

The basic idea behind the view state [feature](https://www.mindstick.com/forum/541/what-is-new-feature-in-sql-server-2012) is that when a form is submitted in ASP .NET, the form reappears in the [browser](https://www.mindstick.com/blog/155254/which-is-the-best-internet-browser) [window](https://www.mindstick.com/forum/132/create-popup-window-in-asp-dot-net) [together](https://yourviews.mindstick.com/view/80819/live-in-relationship-protecting-the-right-to-live-together) with all form values. When we need a page [variable](https://www.mindstick.com/articles/1807/objective-c-data-types-variables-object-creation) to maintain its [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) across page post backs, we can use [ViewState](https://www.mindstick.com/blog/326/viewstate-in-asp-dot-net) to [store](https://www.mindstick.com/articles/13125/tips-to-increase-sales-of-your-woocommerce-store) that value. By [default](https://www.mindstick.com/interview/12771/what-is-the-importance-of-default-resources) ViewState [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) is set to True.\

##### Disable ViewState for Specific control

```
<asp:TextBox ID="txtNum1" runat="server"      EnableViewState="false"></asp:TextBox>
```

##### Disable ViewState for whole page Controls

```
<%@ Page language="C#" EnableViewState="false" %>
```

##

---

Original Source: https://www.mindstick.com/blog/368/viewstate-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
