asp.net - Update dropdown after Items.Clear() -
i populate dropdown several items. when user chooses 1 of these items, second dropdown gets populated. when user clicks on "x" button on first dropdown, 2 dropdown must cleared. first dropdown gets cleared automatically, , clear second dropdown using "dropdown.items.clear()". it happens when load again data first dropdown, second dropdown not update. this code: protected void dropdowndiagstati_selectedindexchanged(object sender, eventargs e) { int selectedindex = this.dropdowndiagstati.selectedindex; populateddlstates(selectedindex); } private void populateddlstates(int selectedindex) { // ottengo diagrammi di stato in sessione arraylist diagrammistato = session["statediagrams"] arraylist; if(selectedindex > 0) { // ottengo il diagramma di stato selezionato docspawr.diagrammastato currdiagstato = (docspawr.diagrammastato)diagrammistato[selectedindex - 1]; ...