Cyberiafreak

"Fortunate are those who take the first steps.” ― Paulo Coelho

Application and Session (most confusious one)mastered…..

Application and Session exposes events in a special file called "global.aspx". In classic asp, one had two events, viz , OnStart and OnEnd, for both the application and session. In the newer version, the application exposes more events providing for greater control. We shall look at application events in the global.asax file.

Application_AuthenticateRequest
This occurs whever a client accesses a resource that needs authentication.

Application_AuthorizeRequest
This occurs whever a client accesses a resource that needs authorization.

Application_BeginRequest
This occurs whenever a client makes a request any page in the application. One can make use of this event to redirect or check the validity of the requested page.

Application_End
This occurs when the application is stopped. This event is used to "clean" up variables and generally memory. This works exactly as in classic asp.

Application_EndRequest
This occurs when a client has completed request for a page.

Application_Error
This event is used to handle all unhandled errors in the application.

Application_PreSendRequestContent
This occurs just before ASP.Net sends the content to the client. One can use this event to push in content to the client.

Application_PreSendRequestHeaders
This occurs just before ASP.Net send the HTTP headers to the client. The header information can be modified using this event.

Application_Start
This event is exactly the same as the start event in classic asp. One can use this event to initialize variables and generally set up the environment. This occurs exactly once during the lifetime of the application, during the start of the application.

Application_Dispose
This event occurs when the application has completed all requests.

Application_Init
This event occurs before the start event and can be used to initialize the application.

Advertisements

February 7, 2005 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: