private void SavePageState(SystemMessagePageState pagestate)
 {
     Session["SystemMessagePageState"] = pagestate;
 }
        private SystemMessagePageState GetPageState()
        {
            try
            {
                SystemMessagePageState pagestate = new SystemMessagePageState();

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