Example #1
0
 /// <summary>
 /// one instance of a page
 /// </summary>
 /// <returns></returns>
 private Boolean ProcessRedirect()
 {
     if (thisPage.ToLower() == "reportprint" || thisPage.ToLower() == "default" || thisPage.ToLower() == "home")
     {
         return(false);
     }
     if (OpenPages.Contains(thisPage))
     {
         return(true);
     }
     return(false);
 }
Example #2
0
        protected void ProcessValidation()
        {
            //one instance of a page
            if (IsPostBack.IsFalse() && OpenPages.IsNotNull() && Request.QueryString.Get("_clearSession").NotEquals("yes"))
            {
                string _isPostBack = Request.QueryString.Get("_isPostBack");
                _isPostBack = _isPostBack.IsNull() ? "" : _isPostBack;

                if (_isPostBack == "yes")
                {
                    Session["_isPostBack"] = "yes";
                }

                if (_isPostBack.Equals("yes") || (Session["_isPostBack"].IsNotNull() && Session["_isPostBack"].Equals("yes")))
                {
                    Session["_isPostBack"] = "yes";
                    return;
                }

                if (ProcessRedirect())
                {
                    //Response.Redirect("~/Security/Message.htm");
                }
                else
                {
                    if (this.OpenPages.Contains(thisPage).IsFalse())
                    {
                        this.OpenPages.Add(thisPage);
                    }
                }
            }
            //End ...........................

            if (IsUserAuthorized().IsFalse())
            {
                Response.Redirect("~/UI/Security/Login.aspx?back_url=" + Server.UrlEncode(Request.Url.AbsoluteUri));
            }
        }