现在的位置: 首页 > 综合 > 正文

.获取错误信息并到指定页面

2013年06月16日 ⁄ 综合 ⁄ 共 253字 ⁄ 字号 评论关闭
不要使用Response.Redirect,而应该使用Server.Transfer
e.g
// in global.asax
protected void Application_Error(Object sender, EventArgs e) {
if (Server.GetLastError() is HttpUnhandledException)
Server.Transfer("MyErrorPage.aspx");

//其余的非HttpUnhandledException异常交给ASP.NET自己处理就okay了 :)
}

抱歉!评论已关闭.