protected void BindSchoolList() { try { SchoolController sysmgr = new SchoolController(); List <Schools> info = null; info = sysmgr.List(); info.Sort((x, y) => x.SchoolName.CompareTo(y.SchoolName)); SchoolList.DataSource = info; SchoolList.DataTextField = nameof(Schools.SchoolName); SchoolList.DataValueField = nameof(Schools.SchoolCode); SchoolList.DataBind(); SchoolList.Items.Insert(0, "select..."); } catch (Exception ex) { errormsgs.Add(GetInnerException(ex).ToString()); LoadMessageDisplay(errormsgs, "alert alert-danger"); } }
protected void BindList() { try { Fetch02.Enabled = false; List02.Enabled = false; SchoolController sysmgr = new SchoolController(); List <Schools> info = null; info = sysmgr.List(); info.Sort((x, y) => x.SchoolName.CompareTo(y.SchoolName)); List01.DataSource = info; List01.DataTextField = nameof(Schools.SchoolName); List01.DataValueField = nameof(Schools.SchoolCode); List01.DataBind(); List01.Items.Insert(0, "select..."); } catch (Exception ex) { MessageLabel.Text = ex.Message; } }
protected void BindSchoolList() { try { SchoolController sysmgr = new SchoolController(); List <Schools> info = null; info = sysmgr.List(); info.Sort((x, y) => x.SchoolCode.CompareTo(y.SchoolCode)); SchoolList.DataSource = info; SchoolList.DataTextField = nameof(Schools.SchoolName); SchoolList.DataValueField = nameof(Schools.SchoolCode); SchoolList.DataBind(); ListItem myitem = new ListItem(); myitem.Value = "0"; myitem.Text = "select..."; SchoolList.Items.Insert(0, myitem); } catch (Exception ex) { ShowMessage(GetInnerException(ex).ToString(), "alert alert-danger"); } }