日期:2014-05-20  浏览次数:20753 次

Dropdownlist在线等待
Dropdownlist控件中的数据从数据库中查询而来,如何设置默认的首项自动被选中?

------解决方案--------------------
默认的首项自动被选中??

DropDownList1.Items.FindByText("某个值").Selected = true;

or

DropDownList1.Items.FindByValue("某个值").Selected = true;
------解决方案--------------------
DropDownList1.Items[指定一个索引].Selected = true;


 如,DropDownList1.Items[1].Selected = true; 最好限制下范围

索引必须小于"DropDownList1.Items.Count" 即索引小于下拉项的个数