Pre-BeginRequest Event

  • Thread starter Thread starter Ryan Senechal
  • Start date Start date
R

Ryan Senechal

I'm looking for an event that fires before
Application_BeginRequest. I was wondering if there is an
event I could catch before the application would have a
chance to throw a 404 error. Any help is appreciated.

-Ryan Senechal
 
Don't you know the Application_Error handler from the global.asax???


Example:

protected void Application_Error(Object sender, EventArgs e)
{
System.Exception err = Server.GetLastError().GetBaseException();
if (err is System.Web.HttpException) {
System.Web.HttpException errHttp = (System.Web.HttpException)err;
// Work with the error here...
}
}


Hope that helped.

Nicolas Dion.
 
Back
Top