private void GhostCastSessionList_ItemCommand(object sender, ListViewCommandEventArgs e) { Agent.GhostCastManagerClient gcmc = new Agent.GhostCastManagerClient(); switch (e.CommandName) { case "Clients": { GridView list = (GridView)e.Item.FindControl("ConnectedClientsGridView"); list.Visible = true; break; } case "Send": { Status.Text = gcmc.SendGhostCastSession(Convert.ToInt32(e.CommandArgument)); this.ViewState["ClientListVisible"] = null; break; } case "Close": { Status.Text = gcmc.CloseGhostCastSession(Convert.ToInt32(e.CommandArgument)); RefreshSessions(false); this.ViewState["ClientListVisible"] = null; break; } } }