.net dropdownlist 動態顯示,指定字段
2020-12-13 02:18
标签:style blog class code java tar .net dropdownlist 動態顯示,指定字段,搜素材,soscw.com .net dropdownlist 動態顯示,指定字段 标签:style blog class code java tar 原文地址:http://www.cnblogs.com/m-t-l/p/3716697.html
dropdownlist 動態顯示,指定字段 this.ddlPermission.Items.Clear();
this.ddlPermission.Items.Insert(0,new ListItem("請選擇",""));
this.ddlPermission.Items.Insert(1,new ListItem("管理01",DEP_ID+"01"));
this.ddlPermission.Items.Insert(2,new ListItem("管理02",DEP_ID+"02"));
this.ddlPermission.Items.Insert(3,new ListItem("檢視03",DEP_ID+"03"));
this.ddlPermission.Items.Insert(4,new ListItem("檢視04",DEP_ID+"04"));
this.ddlPermission.Items.Insert(5,new ListItem("檢視05",DEP_ID+"05"));
foreach(DataRow dr in dt.Rows)
{
this.ddlPermission.Items.Remove(ddlPermission.Items.FindByText(dr["PermissionName"].ToString()));
// foreach(ListItem li in this.ddlPermission.Items)
// {
// Response.Write(li.Text);
// //Response.Write("li.text="+li.Text+"
dr="+dr["PermissionName"].ToString());
// if(dr["PermissionName"].ToString()==li.Text )
// {
// this.ddlPermission.Items.Remove(li.Text);
// }
// }
}
Response.Write("
"+this.ddlPermission.Items.Count);
}