Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is session state, application state in page life cycle?

where is session state, application state in page life cycle?

like image 835
sly_Chandan Avatar asked Jan 28 '11 10:01

sly_Chandan


People also ask

Where is session state stored?

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.

What's the order of events in a page life cycle?

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.

How do I check my session state?

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.

What is session state and application state?

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.


2 Answers

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.

like image 151
El Ronnoco Avatar answered Sep 18 '22 16:09

El Ronnoco


Did you read ASP.NET Page life cycle -
http://msdn.microsoft.com/en-us/library/ms178473.aspx

like image 39
Madhur Ahuja Avatar answered Sep 17 '22 16:09

Madhur Ahuja