- View State is a mechanism, which page state is maintained between page postbacks.
- View State Control is loaded just before the Load event and Fired just before the render method being invoked.
- View State is 64 bit Encoded.
- View State information is stored in Hidden Fields.
- Every Asp.net control has EnableViewState property.
- EnableViewState Mode has two properties. They are True or False.
- If you set EnableViewState property to True, then View State is enabled for the control.
- If you set EnableViewState property to False, then View State is disabled for the control.
- View State Page information is available with in that page only.We can not access the View State information from one page to another page.
Features of ViewState:-
- A way to track the state of the control across Postbacks.
- It does not use the server resources.
- Does not time out
- Works with any browser.
View State information can be configured in 3 levels. They are
- Control Level
- Page Level
- Application Level
Control Level:-
<%@output ..... EnableViewState = "True/False" %>
Page Level:-
<%@Page Language="C#" EnableViewState = "True/False" %>
Application Level:-
It Requires a Configuration file i.e Web.Config.
No comments :
Post a Comment