All,
I am working on the exception handling portion of a web application. When an error occurrs I want the browser to be redirected to a page called errors.aspx. I have the error logging logic in the globabl.asax file and the customErrors defaultRedirect tag defined in my web.config file. When I run my applcation, on the server, and an error occurrs I recieve the built in .net Error Page. Below are the settings in the web.config and the logic in the Application_Error method. I just don't get it...
Web.Config
<customErrors mode="On" defaultRedirect="Errors.aspx"/>
Global.asax
protected void Application_Error(Object sender, EventArgs e)
{
string err = "";
Exception objErr = Server.GetLastError();
err = "<b>Parathon Error Handler...</b><hr><br>" +
"<br><b>Error in: </b>" + Request.Url.ToString() +
"<br><b>Error Message: </b>" + objErr.Message.ToString() +
"<br><b>Target Site: </b>" + objErr.TargetSite.ToString() +
"<br><b>Stack Trace:</b><br>" +
objErr.StackTrace.ToString();
}
Thanks
Jim