阅读601 返回首页    go 阿里云 go 技术社区[云栖]


Dropdownlist添加一项——"请选择"

 protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
            }

          this.drpDownDepartment.Items.Insert(0, new ListItem("请选择部门", "0"));

        }

 

在调用的时候,需要做一个判断:

           

            if (this.drpDownDepartment.SelectedItem.Text != "请选择部门......")
            {
                StaffBLL.UpdateStaffDepIDByID(this.lblNum.Text, departmentID);
            }

最后更新:2017-04-02 22:15:58

  上一篇:go Treeview中利用递归无限绑定
  下一篇:go DataList留言板