dropdownlist赋值
this.name.SelectedItem.Selected = false;
string tlmbk = row[ "name "].ToString();
for (int i = 0; i < this.name.Items.Count; i++)
if (this.name.Items[i].Value == tlmbk)
{
this.name .Items[i].Selected = true;
break;
}
}
为什么报 this.ggw.SelectedItem.Selected = false;错 说没用NEW创建对象
但把this.ggw.SelectedItem.Selected = false去掉 不报错 但值赋不过去
这问题怎么解决啊 谢谢
------解决方案--------------------如果是dropdownlist,你可以直接给ddl.SelectedValue=tlmbk来做啊