示例#1
0
 private void SavePageState(ScreenPageState pagestate)
 {
     Session["ScreenPageState"] = pagestate;
 }
示例#2
0
        private ScreenPageState GetPageState()
        {
            try
            {
                ScreenPageState pagestate = new ScreenPageState();

                // Initialize the session values if they don't exist - need to do this the first time controller is hit
                if (Session["ScreenPageState"] == null)
                {
                    int accountid = 0;
                    if (Session["UserAccountID"] != null)
                        accountid = Convert.ToInt32(Session["UserAccountID"]);

                    pagestate.AccountID = accountid;
                    pagestate.ScreenName = String.Empty;
                    pagestate.Description = String.Empty;
                    pagestate.IncludeInactive = false;
                    pagestate.SortBy = "ScreenName";
                    pagestate.AscDesc = "Ascending";
                    pagestate.PageNumber = 1;
                    Session["ScreenPageState"] = pagestate;
                }
                else
                {
                    pagestate = (ScreenPageState)Session["ScreenPageState"];
                }
                return pagestate;
            }
            catch { return new ScreenPageState(); }
        }