Search This Blog

Monday, 7 December 2015

Diffrence between ViewState, Session State & Application State Variables.


ViewState:
o   ViewState of a webform is available only with in that webform
o   ViewState is stored on the page in a hidden field called_ViewState. Because of this, the ViewState, will be lost, if you navigate away from the page, or if the browser is closed.
o   ViewState is used by all asp.net controls to retain-> (Continue to hold) their state across postback.

Session State:
o   Session state variables are available across all pages,  but only for a given single session. Session variables are like single-user global data.
o   Session state variables are stored on the web server.
o   Session state variables are cleared, when the user session times out. The default is 20 minutes. This is configurable in web.config

Application State:
o   Application State variables are available across all pages and across all sessions. Application State variables are like multi-user global data.
o   Application State variables are stored on the web server.
o   Application State variables are cleared, when the process hosting the application is restarted.

No comments:

Post a Comment