Home > DeveloperSection > Blogs > ViewState in ASP.Net

ViewState in ASP.Net

ASP.Net ASP.Net 
0 Comment(s)
 2218  View(s)
Rate this:

ViewState in ASP.Net

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 form values. When we need a page variable to maintain its value across page post backs, we can use ViewState to store that value. By default ViewState property 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" %>


Don't want to miss updates? Please click the below button!

Follow MindStick