public static void RedirectToAccessDeniedPage(string reasonCode, bool useStaticPage, string queryString) { if (useStaticPage) { HttpContext.Current.Response.Redirect("~/Local/AccessDenied.htm?" + reasonCode, true); } else { Authentication.SignOut(); HttpContext.Current.Session.Abandon(); HRef page = new HRef(Global.SiteRootPath + "/AccessDenied.aspx"); page["ReasonCode"] = reasonCode; page.Merge(queryString); HttpContext.Current.Response.Redirect(page.ToString(), true); } }