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: 13344    |  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" 

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" />

Post Definition  |  Definiton Home

User Responses

No response found, be the first to review this definition.

Submit feedback about this definition

Please sign in to post feedback

Latest Posts