protected void Application_Error(object sender, EventArgs e) { log4net.LogManager.GetLogger(this.GetType()).Error(sender + e.ToString()); #if RELEASE Server.ClearError(); string url = AspNetHelper.WebUrl() + "/Error.htm"; Response.Redirect(url); // Response.Write("程序出现错误,请重新操作"); Response.End(); #endif }