·       Viewstate is one of the most important and useful client side state management mechanisms.

·       It can store the page value at the time of post back of your page.

·       ASP.NET pages provide the View State property as a built-in structure for automatically storing values between multiple requests for the same page.

·       There are two level of view state:

1.     Page level

2.     Control level

·       Page Level view state control treat as highest priorities.

·       Which means If we set EnableViewState= “False” in page level, that will automatically be derived by all the server side controls. In that case, if we set  EnableViewState=”True”  for any server side control will treat it as false, as we have defined them “False” in Page Level.

·       Apply the view state at page level:

o     Page level means apply viewstate property to page.

o     To apply the viewstate at page level set the property  EnableViewState  of  page

o     Now , if set the EnbleViewState property = “true” then all the server control derived this property as true.

o     If we set the EnbleViewState property = “false” then all the server control derived this property as false.

·       Apply the view state at control level:

o     Control level means apply viewstate property on controls used in page.

o     To apply the viewstate at control level then set the enableviewstate property of each control on which you want to set.

o     Ex. <asp:DropDownList ID=”DropDownList1″ runat=”server” EnableViewState=”true”> </asp:DropDownList>

o     If you apply page level as false then this property will not work because pagelevel has high priority.

Hide

Managed by

MNP INFOTECH