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

                // Initialize the session values if they don't exist - need to do this the first time controller is hit
                if (Session["UserPageState"] == null)
                {
                    int accountid = 0;
                    pagestate.AccountID = accountid;
                    pagestate.Username = String.Empty;
                    pagestate.IncludeInactive = false;
                    pagestate.SortBy = "Username";
                    pagestate.AscDesc = "Ascending";
                    pagestate.PageNumber = 1;
                    Session["UserPageState"] = pagestate;
                }
                else
                {
                    pagestate = (UserPageState)Session["UserPageState"];
                }
                return pagestate;
            }
            catch { return new UserPageState(); }
        }