The ASP.Net runtime uses the dynamic method search function with names like "Application_Start", "Session_Start", etc., and then binds to the corresponding events of the HttpApplication class. You can effectively bind to any of the HttpApplication events by simply including the method in Global.asax.cs, whose name is "Application_" and then the name of the event. For example, to use the EndRequest event, add it to the Global.asax.cs file:
protected void Application_EndRequest(object sender, EventArgs e)
{
}
See Rick Strall's blog post for tons of helpful information on how to do this.
Joshl source
share