【发布时间】:2009-03-20 04:40:54
【问题描述】:
我已经设置自定义错误如下..
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);
}
我想知道是否可以检测这个错误是不是404错误,然后显示默认的404错误?
【问题讨论】:
标签: asp.net