ddlAppID.ClearSelection();//清除选择项,不清除会报错“不能同时选中多项”
string strUnitName = “测试单位”;
ListItem item = ddlAppID.Items.FindByText(strUnitName);
if (item != null)
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "PopInfo", "<script>GetUserInfoByAppID(" + item.Value + ")</script>");
}
string strUnitName = “测试单位”;
ListItem item = ddlAppID.Items.FindByText(strUnitName);
if (item != null)
{
item.Selected = true;
// 设置成功后,可以直接调用页面的JS方法
}