public virtual void ProcessRequest(HttpContext context)
 {
     User = SessionWrapper.Get <T>("UserInfo", null);
     if (User == null)
     {
         string url = context.Server.UrlEncode(context.Request.Url.PathAndQuery);
         if (String.IsNullOrEmpty(url))
         {
             context.Response.Redirect(GetConfigString("LoginPage", RedirectPage), true);
         }
         else
         {
             context.Response.Redirect(GetConfigString("LoginPageWithRedirect", String.Concat(RedirectPage, "?", RedirectVariable, "=", url)), true);
         }
     }
 }
Example #2
0
 protected override void OnPreInit(EventArgs e)
 {
     base.OnPreInit(e);
     User = SessionWrapper.Get <T>("UserInfo", null);
     if (User == null)
     {
         string url = Server.UrlEncode(Request.Url.PathAndQuery);
         if (String.IsNullOrEmpty(url))
         {
             Response.Redirect(GetConfigString("LoginPage", RedirectPage));
         }
         else
         {
             Response.Redirect(GetConfigString("LoginPageWithRedirect", String.Concat(RedirectPage, "?", RedirectVariable, "=", url)));
         }
     }
 }