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