There are mainly two ways to maintain state of a page.
1) client side state management
2) server side state management
Client side state management:
a) View state : Temprorary storage of controls value of a page during postbacks.
b) Control state: Control state property allows to persist property information of a control, it can not be off as view state can be off.
c) Hidden fields: You can also store values in hidden fields, hidden fields are not visible to browser, it is rendered as HTML hidden field.
d) Cookies: Store values in a text file or in memory client browser's session. It stores small amount of data.
e) Query strings: Using query string send values one page to another with URL.
Server side state management
a) Application state: You can also store values in application state, it is accessible from any page in web application, Application state persists data through out the application, you can store application specific information in it. Data stores in application persists for all users.
b) Session state: It is similar to application state but the difference is it store value for user specific or browser specific. You can store any value or data structure in session. Session data lost when user's session expired.
c) Profile properties It stores user specific data, It is similar to session state but profile data persist even user session expired.
Asked In: Many Interviews |