where is session state, application state in page life cycle?
Session state can be stored in one of the following modes: In - Process: Stored in the same ASP.Net Process. State Server: Stored in the some other system. SQL Server: Stored in the SQLServer database.
When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, instantiating controls, restoring and maintaining state, running event handler code, and rendering.
SessionStateModule or a custom session state module is included in the \\ section in the application configuration. The check happens in the Load event of a base page class that all my aspx pages derive from. The app has the session enabled, and it has the module listed in the httpModules node.
Application state is a global storage mechanism that is used to store data that needs to be available to all users of an ASP.NET application. Session state, on the other hand, is a per-user storage mechanism that is used to store data that is specific to a user's session.
The Session and Application states are independent of the page lifecycle and can be accessed at any point during the page lifecycle.
Objects or variables which you store in session/application state will be persisted across postbacks on the server. Once they are there, they stay there, for the duration of the client session (in the case of SessionState) or for the duration of the application (in the case of ApplicationState).
This probably takes a few liberties in terms of accuracy but this is how I generally think of this mechanism as working.
Did you read ASP.NET Page life cycle -
http://msdn.microsoft.com/en-us/library/ms178473.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With