HttpContext.Current.Session["Exception"] = HttpContext.Current.Server.GetLastError(); Response.Redirect("http://www.dominio.it/ErrorPage.aspx");