public partial class Login : FormsSignInPage { protected override void OnInit(EventArgs e) { base.OnInit(e); bool testJS = IsJSEnabled; if (Request.QueryString[JSQRYPARAM] != null) { IsJSEnabled = Request.QueryString[JSQRYPARAM] == JSENABLED; } } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (IsJSEnabled) { string targeturl = GetAppendedUrl(JSQRYPARAM, JSDISABLED); HtmlGenericControl ctrl = new HtmlGenericControl("NOSCRIPT"); ctrl.InnerHtml = string.Format("<meta http-equiv=REFRESH content=0;URL={0}>", targeturl); Page.Header.Controls.Add(ctrl); } else { if (!string.IsNullOrEmpty(NonJSTargetURL)) Response.Redirect(NonJSTargetURL); HtmlGenericControl ctrl = new HtmlGenericControl("NOSCRIPT"); ctrl.InnerHtml = string.Empty; Page.Header.Controls.Add(ctrl); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)