I am unable to use Redirect
or Response.Write
in my application when either the Application_End
or Application_Error
events occur.
protected void Application_Error(object sender, EventArgs e)
{
string strError;
strError = Server.GetLastError().ToString();
this.Context.ClearError();
Response.Write("Application_Error" + "<br/>");
Response.Write("Error Msg: " + strError + "<br/>");
}
Any help would be much appreciated, thanks
Edited: I am trying to detect application pool recycle and redirect to an error page.