protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataRetrieval retrieve = new DataRetrieval(); List <PlayerRoster> playerRoster = retrieve.SelectAllPlayers(); if (Session["login"].ToString() == "loggedIn") { PlayerRosterGridView.AutoGenerateEditButton = true; PlayerRosterGridView.AutoGenerateDeleteButton = true; SavePlayerChanges.Visible = true; if ((bool)Session["PlayerChanges"] == false) { SavePlayerChanges.Enabled = false; SavePlayerChanges.Visible = false; } else { SavePlayerChanges.Enabled = true; } AddPlayer.Visible = true; } if (Cache["PlayerRoster"] == null) { Cache.Insert("PlayerRoster", playerRoster); } PlayerRosterGridView.DataSource = (List <PlayerRoster>)Cache["PlayerRoster"]; PlayerRosterGridView.DataBind(); } }