protected void Fetch_Click(object sender, EventArgs e) { if (List01.SelectedIndex == 0) { MessageLabel.Text = "Select a team to view its players"; } else { try { //Controller01 Teamsysmgr = new Controller01(); //List<Entity01> Teaminfo = null; //Teaminfo = Teamsysmgr.FindByID(int.Parse(List01.SelectedValue)); ////info.Sort((x, y) => x.ProductName.CompareTo(y.ProductName)); //TeamInfo.DataSource = Teaminfo; //TeamInfo.DataBind(); TeamInfoLabel.Text = "Team Information"; Controller01 Teamsysmgr = new Controller01(); List <Entity01> Teaminfo = null; Teaminfo = Teamsysmgr.FindByID(int.Parse(List01.SelectedValue)); //Teaminfo = Teamsysmgr.List(); TeamInfo.DataSource = Teaminfo; TeamInfo.DataBind(); RosterLabel.Text = "Team Roster"; Controller02 sysmgr = new Controller02(); List <Entity02> info = null; info = sysmgr.FindByID(int.Parse(List01.SelectedValue)); info.Sort((x, y) => x.PlayerName.CompareTo(y.PlayerName)); //info.Sort((x, y) => x.ProductName.CompareTo(y.ProductName)); List02.DataSource = info; List02.DataBind(); } catch (Exception ex) { TeamInfoLabel.Text = ""; RosterLabel.Text = ""; MessageLabel.Text = ex.Message; } } }