protected void DDLModel_SelectedIndexChanged(object sender, EventArgs e) { GenericVehicle gv = new GenericVehicle(); //Vehicle Year //Need to clear the combobox before adding new items DDLYear.Items.Clear(); DDLYear.Items.Insert(0, ""); foreach (string year in gv.SearchVehicleYear(DDLModel.Text)) { DDLYear.Items.Add(year); } }
protected void ModelDDL_SelectedIndexChanged(object sender, EventArgs e) { GenericVehicle gv = new GenericVehicle(); //Vehicle Year //Need to clear the combobox before adding new items YearDDL.Items.Clear(); YearDDL.Items.Insert(0, ""); foreach (string year in gv.SearchVehicleYear(ModelDDL.Text)) { YearDDL.Items.Add(year); } YearDDL.DataBind(); }