我要对一个dropdownlist重新绑定,因为并不是每次都有绑定值,所以需要对其原绑定清空,请问如何做!
------解决方案--------------------------------------------------------
this.DropDownList1.DataSource = null;
this.DropDownList1.DataBind();
------解决方案--------------------------------------------------------
if (DropDownList1.Items.Count > 0)
DropDownList1.Items.Clear();
------解决方案--------------------------------------------------------
DropDownList1.Items.Clear();
------解决方案--------------------------------------------------------
上面两种方法都可以!