private void BindDropDownList(DropDownList drop,List<Model.City>list)
{
for(int i=0;i <list.count;i++)
{
drop.Items.Add(new listitem(list[i].name,list[i].Id));
}
}
//默认选中某一项,作为当前项
private void DropDwonListIndex_Bind(DropDownList drop,string name)
{
for (int i=0;i<drop.items.count;i++)
{
if(drop.text==name)
{
drop.selectedIndex=i;
}
}
}
转载于:https://www.cnblogs.com/xiaochen88/archive/2012/12/26/2833439.html
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/110243.html原文链接:https://javaforall.net