后台根据文本定位DropDownList选中值

        ddlAppID.ClearSelection();//清除选择项,不清除会报错“不能同时选中多项”
        string strUnitName = “测试单位”;
        ListItem item = ddlAppID.Items.FindByText(strUnitName);
        if (item != null)
        {

            item.Selected = true;

  // 设置成功后,可以直接调用页面的JS方法

            Page.ClientScript.RegisterStartupScript(Page.GetType(), "PopInfo", "<script>GetUserInfoByAppID(" + item.Value + ")</script>");
        }

猜你喜欢

转载自blog.csdn.net/lin304510260/article/details/40977187