url = "http://" + System.Web.HttpContext.Current.Request.ServerVariables.Get("Local_Addr").ToString() + ":" + System.Web.HttpContext.Current.Request.Url.Port +
"/error.aspx?type=" + System.Web.HttpContext.Current.Server.UrlEncode("连接超时!");
//System.Web.HttpContext.Current.Response.Write("<script>window.open('" + url + "'); window.opener = null; window.close();</script>");
System.Web.HttpContext.Current.Response.Redirect(url);
<customErrors>
<customErrors defaultRedirect="ErrorPage.aspx" mode="RemoteOnly">
</customErrors>