|M| 将才做的错误处理有一个天大的错误
protected void Application_Error(Object sender, EventArgs e)
{
// 在出现未处理的错误时运行的代码
Exception error = HttpContext.Current.Server.GetLastError();
String Path = Request.Url.ToString();
Response.Redirect(String.Format("/web/error/404page.aspx?Path={0}&Error={1}&Detail={2}", Path, Server.UrlEncode(error.Message),Server.UrlEncode(error.ToString())));
}
页面
protected void Page_Load(object sender, EventArgs e)
{
throw new Exception("出错");
}
这个时候上面就没有做用了
我的理解是
Response.Redirect
这里因为 在这个网页load的时候出错他也没有办法执行这条语句