asp.net中DropDownList添加“请选择”提示
2012-02-13 06:45
411 查看
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);
}
{
if (!IsPostBack)
{
Bind();
}
this.drpDownDepartment.Items.Insert(0, new ListItem("请选择部门", "0"));
}
在调用的时候,需要做一个判断:
if (this.drpDownDepartment.SelectedItem.Text != "请选择部门......")
{
StaffBLL.UpdateStaffDepIDByID(this.lblNum.Text, departmentID);
}
相关文章推荐
- asp.net中不能在DropDownList中选择多个项 原因分析及解决方法
- Asp.net-不能在DropDownList中选择多个项
- 每日总结(二)C#判断输入内容为数字、Sharepoint回收应用程序池错误、Asp.Net 会发或回调参数无效、DropDownList动态绑定且设置默认选择项
- ASP.NET中如何让DropDownList控件既能做选择又能做输入用?
- ASP.NET中用三个DropDownList控件方便的选择年月日
- ASP.NET 2.0中给DropDownList服务器控件添加项的新方法
- 在IIS7.5上添加.NET4.0程序的虚拟目录时提示ASP.NET 4.0尚未在 Web 服务器上注册
- ASP.NET中如何让DropDownList控件既能做选择又能做输入用(转载)
- ASP.NET中为GridView添加删除确认提示框
- ASP.NET中时间选择控件的添加
- asp.net中不能在DropDownList中选择多个项 原因分析及解决方法
- ASP.NET文本框中添加日期选择控件
- 在asp.net后台给DropDownList添加项
- 在ASP.NET中用三个DropDownList控件方便的选择年月日【原创】
- [备用]权限设计方案、如何使用session、MVC如何使用模板、DropdownList、怎么添加Bootstrape框架、使用ASP.NET MVC 4 Bootstrap Layout Template(VS2012)
- Asp.net 关于错误提示 类型“XXX1”在未被引用的程序集中定义,必须添加对程序集XXX2的引用
- 每日总结(二)C#判断输入内容为数字、Sharepoint回收应用程序池错误、Asp.Net 会发或回调参数无效、DropDownList动态绑定且设置默认选择项
- asp.net给DropDownList添加ToolTip(title)属性
- ASP.NET提示框,且根据用户选择执行不同代码的实现
- ASP.NET Repeater 绑定 DropDownList Calendar 选择日期