protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
This methor helps you to do perform and to do some work in the methord.
Then enable the autopost back of drop down then it will work
DropDownList Events The DropDownList control raises the SelectedIndexChanged
event when users select an item. By default, this event does not cause
the page to be posted to the server. However, you can cause the control
to force an immediate post by setting the AutoPostBack property to true.
YOU CAN ALSO USE THE CLEAR SYNTAX
- Code:
-
DropDownList2.Items.Clear();