What is State Management & Techniques to manage state.
Web pages are created each time a page is posted to a server. It means that all information associated with the page and the controls within the page would be lost with each round trip, as Http is stateless protocol.
However in spite drawback of maintaining state most of the web sites use/require the user specific state to function properly, to track individual request and provide the content which are requested specifically.
To overcome limitation of Web programming, the ASP.NET page framework includes various options to help you preserve changes when managing the State. The page framework includes a facility called view state that automatically preserves property values of the page and all controls on it between round trips.
However, we will probably also have application-specific values that we want to preserve. This can be done using state management options.
In Simple means State Management means retaining the information between requests or from one page to next.
State management can be handled in two ways –
1) Client Side State Management
- View State
- Hidden Fields
- Query Strings
2) Server Side State Management
- Application State
- Session State
- Database (supported usually with the help of cookies)