protected void Clear_Click(object sender, EventArgs e) { FullName.Text = ""; EmailAddress.Text = ""; Phone.Text = ""; //for Lists there are a couple of ways to reset // a) manually reset the control SelectionIndex // for the RadioButtonList, set the index -1 FullOrPartTime.SelectedIndex = -1; // b) most list controls have a bult in method to clear // this clearing can be the selection and /or the item contents JobLists.ClearSelection(); }
private void cmbDept_SelectedIndexChanged(object sender, EventArgs e) { if (cmbDept.SelectedIndex > -1) { cmbJobTitle.DataSource = null; var dept = (Department)Enum.Parse(typeof(Department), cmbDept.SelectedValue.ToString(), true); var jobList = JobLists.getJobsByDept(dept); cmbJobTitle.DataSource = jobList; cmbJobTitle.DisplayMember = "Title"; cmbJobTitle.ValueMember = "JobId"; txtSupervisor.Text = Job.GetSupervisor(dept); } }