protected void Clear(object sender, EventArgs e) { ID.Text = ""; Name.Text = ""; Diploma.Text = ""; Tuition.Text = ""; IntTuition.Text = ""; SchoolsList.ClearSelection(); }
protected void BindSchoolsList() { try { SchoolsController sysmgr = new SchoolsController(); List <Schools> info = null; info = sysmgr.List(); info.Sort((x, y) => x.SchoolName.CompareTo(y.SchoolName)); SchoolsList.DataSource = info; SchoolsList.DataTextField = nameof(Schools.SchoolName); SchoolsList.DataValueField = nameof(Schools.SchoolCode); SchoolsList.DataBind(); ListItem myitem = new ListItem(); myitem.Value = "0"; myitem.Text = "select..."; SchoolsList.Items.Insert(0, myitem); //CategoryList.Items.Insert(0, "select..."); } catch (Exception ex) { ShowMessage(GetInnerException(ex).ToString(), "alert alert-danger"); } }