标签:ble script datatable oid list empty value role pdo
DataTable dt = Utility.Getrole();
DroList.DataSource = dt;
DroList.DataTextField = "description";
DroList.DataValueField = "name";
DroList.DataBind();
DroList.Items.Insert(0, new ListItem("请选择", "请选择"));
SetDropListDefaultStatus(DroList)
//触发事件
AutoPostBack设置为True,SelectedIndexChanged事件里写你需要做的代码
//下拉框缺省为空
public void SetDropListDefaultStatus(DropDownList list)
{
list.Items.Insert(0, new ListItem(String.Empty, String.Empty));
list.SelectedIndex = 0;
}
标签:ble script datatable oid list empty value role pdo
原文地址:http://www.cnblogs.com/illegal/p/6374020.html