protected void ClearButton_Click(object sender, EventArgs e) { TeamList.ClearSelection(); Coach.Text = null; AssistantCoach.Text = null; Wins.Text = "0"; Losses.Text = "0"; TeamListV2.ClearSelection(); TeamNameV2.Text = null; CoachNameV2.Text = null; AssistantCoachV2.Text = null; WinsV2.Text = "0"; LossesV2.Text = "0"; TeamListV3.ClearSelection(); TeamIDV3.Text = null; TeamNameV3.Text = null; CoachV3.Text = null; AssistantCoachV3.Text = null; WinsV3.Text = "0"; LossesV3.Text = "0"; TeamListV4.ClearSelection(); TeamIDV4.Text = null; TeamNameV4.Text = null; CoachV4.Text = null; AssistantCoachV4.Text = null; WinsV4.Text = "0"; LossesV4.Text = "0"; }
protected void BindTeamList() { try { //Works TeamController sysmgr = new TeamController(); List <Team> datainfo = sysmgr.Team_List(); datainfo.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = datainfo; TeamList.DataTextField = nameof(Team.TeamName); TeamList.DataValueField = nameof(Team.TeamID); TeamList.DataBind(); TeamList.Items.Insert(0, "select ...."); TeamListV2.DataSource = datainfo; TeamListV2.DataTextField = nameof(Team.TeamName); TeamListV2.DataValueField = nameof(Team.TeamID); TeamListV2.DataBind(); TeamListV2.Items.Insert(0, "select ...."); } catch (Exception ex) { errormsgs.Add(GetInnerException(ex).ToString()); LoadMessageDisplay(errormsgs, "alert alert-danger"); } }