public override void OnAuthorization(AuthorizationContext filterContext) { var url = string.Format("{0}?ReturnUrl={1}", FormsAuthentication.LoginUrl, filterContext.HttpContext.Request.RawUrl); if (SessionHelper.Get("UserName") == null) filterContext.HttpContext.Response.Write( "<script>alert('Login overtime!Loggin again please!'); window.location.href='"+url +"';</script>"); }
public override void OnAuthorization(AuthorizationContext filterContext) { var url = string.Format("{0}?ReturnUrl={1}", FormsAuthentication.LoginUrl, filterContext.HttpContext.Request.RawUrl); if (SessionHelper.Get("UserName") == null) filterContext.Result = new ContentResult { ContentType = "text/html", Content = "<script>alert('Login overtime!Loggin again please!'); window.location.href='" + url + "';<script>" }; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)