private void SavePageState(SlideShowPageState pagestate) { Session["SlideShowPageState"] = pagestate; }
private SlideShowPageState GetPageState() { try { SlideShowPageState pagestate = new SlideShowPageState(); // Initialize the session values if they don't exist - need to do this the first time controller is hit if (Session["SlideShowPageState"] == null) { int accountid = 0; if (Session["UserAccountID"] != null) accountid = Convert.ToInt32(Session["UserAccountID"]); pagestate.AccountID = accountid; pagestate.SlideShowName = String.Empty; pagestate.Tag = String.Empty; pagestate.IncludeInactive = false; pagestate.SortBy = "SlideShowName"; pagestate.AscDesc = "Ascending"; pagestate.PageNumber = 1; Session["SlideShowPageState"] = pagestate; } else { pagestate = (SlideShowPageState)Session["SlideShowPageState"]; } return pagestate; } catch { return new SlideShowPageState(); } }