When a ASP.NET web application is launched, a series of steps are carried out. These steps combined are known as Application Life Cycle.
Below are the life cycle steps:
- Application Start: Application’s lifecycle starts when a user makes a request for a web application to the web server. This generally happens when the first user visits the web application for the first time. At this time, a method named Application_Start is executed by the web server. All global variables are set set to their default value in this method. If there is any other initialization, that is also done in this method.
- Object Creation: Application objects such as HttpContext, HttpRequest and HttpResponse are created and initialized. HttpContext object will be created newly for every request made to the application and acts as a container for for HttpRequest, HttpResponse, Server, Session, Cache, User details etc. HttpRequest object contains information about current request, cookies, browser information etc. HttpResponse contains the response that is sent back to the client.
- HttpApplication object created: HttpApplication object is created and assigned to the request. The request is processed by this object by calling various events.
- Dispose: This method is called before the application instance is destroyed. This can be used to manually release any unmanaged code.
- Application End: At this stage, application is finally unloaded from memory.








