Monday, May 21, 2012

Introduction to State Management

State management is the process by which you maintain state and page information over multiple requests for the same or different pages.


Types of State management:

  • Client side state Management
  • Server side state management

Client side State Management :
    This stores information on the client's computer by embedding the information into a Web page, a URLor cookie.Following  techniques are available to store the state information at client side:
            1. Cookies: 
                      Cookies store a value in the user's browser that the browser sends with every page request to the same server. Cookies are the best way to store state data that must be available for multiple Web pages on a web site. 
         
            2. View State: 
                     Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state. It is used by the Asp.net page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state. 


         3.Control State: 
                    If you create a custom control that requires view state to work properly, you should use control state to ensure other developers don’t break your control by disabling view state. 


Server side State Management: 
        1.Application State - Application State information is available to all pages, instead of which user requests a page. 

        2.Session State – Session State information is available to all pages opened by a user during a single visit. 

No comments:

Post a Comment