"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Saturday, April 30, 2011

Introduction to Global.asax file

Global.asax file is a ASP.Net application file that is optional file.This file contains code for responding to
application-level events raised by ASP.Net based solution.The global.asax file resides in the root directory
of asp.net based application. The Global.asax file is configured so that any direct HTTP request(via URL)is rejected automatically.so user can not download or view its contents.The asp.net framework recognizes automatically any changes that are made to global.asax file.The framework reboot all the application,flushes all state information,closing browsers and restart the apllication domain.
The Global.asax file contain the following events:

1-Application-Init:-This event fired when an application initializes or is first called.It is invoked for all httpApplication object instances.

2-Application_Disposed:  This event fired just before an application destroy.This is ideal location for cleaning previous used resourse.

3-Application_Error:This event fired when an unhandled exception is encountered within the appliction.

4-Application_Start-: This event fired when the first instance of the httpApplication class is created.
     it allows you to create  objects that are accessible by all the HttpAppplicaton instances.

5-Application_End: This event fired when the last instances of HttpApplication class is destroyed.It
  is fired only once during the apllications lifetime.

6-Application_BeginRequest: Fired when application  request is received.It is the first events fired for a request.This is often a page request that a user enters.

7-Application_EndRequest: The last events fired for an appllications request.

8-Session_Start: Fired when a new user visits the appllication web sites.

9-Session_End: Fired when a user's session times out,ends or they leave the application web sites.

10-Application_PreRequestHandlerExecute: This event fired before the ASP.NET page framework begins executing an event handler like pages or web services.

11-Application_PostRequestHandlerExecutes: This events fired when the ASP.NET page framework is finished executing an event handler.

12-Application_PreSendRequestHeaders: This event fired before the ASP.NET page framework sends HTTP headers to a requesting clients.

13-Application_PreSendContent: Fired before the ASP.NET page framework sends content to a requesting client(browser).

14-Application_AcquireRequestState: Fired when the ASP.NET page framework gets the current state(session state)  related to the current page request.

15-Application_RealeaseRequestState: Fired when the ASP.NET page framework completes execution of all events handlers.This result in all state modules to save their current state data.

16-Application_UpdateRequestCache: Fired when the ASP.NET page framework completes handler execution to allow caching modules to store responses to be used to handle subsequent request.

17-Application_AuthenticateRequest: Fired when the security modules has established the dcurrent user's identity as valid.At This piont ,the user's crenditials have been validated.

18-Application_AuthorizeRequest: Fired when the security modules has verified that the user can access resources.


Hope u got It....
Stay Tune...
Have a nice day... 'N happy Coding :)

No comments: