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


asp.net中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:16:22

  上一篇:go mysql 触发器
  下一篇:go jQuery中after的用法