I have setup custom error as follows..
protected void Application_Error(Object sender, EventArgs e)
{
Exception ex = HttpContext.Current.Server.GetLastError();
if (ex is HttpUnhandledException && ex.InnerException != null)
ex = ex.InnerException;
if (ex != null)
{
try
{
Logger.Log(LogEventType.UnhandledException, ex);
}
catch
{ }
}
HttpContext.Current.Server.ClearError();
Response.Redirect(MyCustomError);
}
I am wondering if it is possible to detect if this error is a 404 error, and then show the default 404 error?