I have a dropdownlist, and in some cases need to remove an item (in the code-behind). I need to remove the item based on the value of the item.
How can I do this?
I have a dropdownlist, and in some cases need to remove an item (in the code-behind). I need to remove the item based on the value of the item.
How can I do this?
You can use the
or
to remove it using C#.
myDropDown.Items.Remove(myDropDown.Items.FindByText("Chicago"));
I would add an identifying Id or class to the dropbox and remove using Javascript.
The article here should help.
D