Share via


Application Lifecycle

This topic describes the workflow of the application when an ASP.NET application starts.

  1. A request arrives and the ASP.NET runtime creates an AppDomain for the application. It then creates the first instance of the HttpApplication class within the AppDomain. The AppDomain might create subsequent instances of the HttpApplication class, because ASP.NET can create a pool of instances. Each request to the Web server is serviced by a single instance of the HttpApplication class.
  2. ASP.NET fires the OnStart event. This is normally synced by the Application_Start event handler in the global.asax file.
  3. The HttpApplication class creates and initializes the HTTP modules for servicing the application request. Modules are initialized in the order in which they appear in the web.config file. Some of the HTTP modules created are Commerce Modules. The Init method for each module is called, in which the module can subscribe to other request-processing events raised by the HttpApplication class.
  4. The Init method of the HttpApplication class is called. The Init method is a virtual method that can be overridden in the global.asax file; however, unlike the Application_Start event handler, the Init method is called once per HttpApplication class instance.
  5. Before ASP.NET terminates the AppDomain, the OnEnd event is raised by the HttpApplication class.

See Also

Request Lifecycle

Copyright © 2005 Microsoft Corporation.
All rights reserved.