Clearing a drop down list value on a web form

Ran into this issue with trying to clear a data linked drop down list on a web form, it was tricky because there are two controls for the drop down list, the first one being the ‘source’ and the second one being the sub-source. All I had to do was clear the source by using the following line:

ddlSource.SelectedIndex = -1;

Comments are closed.