Home > Definition > .NET > What is viewstate in ASP.NET?

What is viewstate in ASP.NET?

by Narain_Siddharth   on May 08, 2011   Category: .NET   |  Views: 999    |  Points: 25   |  Silver 




It is a state management technique in asp.net. ASP.NET Viewstate is preserving the data between the requests or postbacks and stored in hidden fields on the page. if you open the source of the aspx page you will see like

<input type="hidden" name="__VIEWSTATE" 
value="dDwyMTQxMjc4NDIxO3Q8O2w8aTw4Pjs+O2w8dDwfg==>


To disable viewstate in the application we need to configure in page for particular page only or web.config file for application level

To disable viewstate in page level

<%@  Page Language="C#" AutoEventWireup="true" CodeBehind="..."
MasterPageFile..." Inherits="..." EnableViewState="false" %>


Add the following line in web.config file to disable the viewstate in application level

<pages enableViewState="false" />



Like this definition? Bookmark and Share:

  User Responses | Post Definition
 No Response found!
  Recent Posts
* what is bubbled event in .NET? (483) by Shiva on May 4 2011 1:09AM
* What is a satellite assembly in .NET? (597) by Shiva on May 4 2011 12:22PM
* What is viewstate in ASP.NET? (999) by Narain_Siddharth on May 8 2011 4:27AM
* What does SOAP stands for? (362) by Spidy on May 17 2011 5:30AM
* What does WSDL stands for? (348) by Spidy on May 17 2011 5:31AM
  Submit feedback about this definition
Please sign in to post feedback