dropDownList 控件动态绑定数据和读取
来源:互联网 发布:c语言入门课程 编辑:程序博客网 时间:2024/05/01 15:13
1、绑定:
方法一:
IList<NHibernate.Domain.Organization> orgs = itls.GetAllOrganization();
this.ddl.DataSource = orgs;
//指定DropDownList使用的表里的那些字段
this.ddl.DataTextField = "OrganizationName"; //dropdownlist的Text的字段
this.ddl.DataValueField = "OrganizationID";//dropdownlist的Value的字段
this.ddl.DataBind();
方法二:
this.ddl.Items.Add(dr["CompanyType"].ToString());
2、读取:
(1)读文本值
string a = this.orgParentID.Text;
(2)读绑定的value值
int b = Convert.ToInt32(this.ddl.SelectedValue);
- dropDownList 控件动态绑定数据和读取
- dropdownlist控件如何绑定动态数据
- dropdownlist 动态绑定数据
- DropDownList 控件如何绑定数据
- DropDownList控件的数据绑定
- DropDownList控件的数据绑定
- DropdownList控件动态绑定数据源两…
- ListItem和DropDownList绑定数据
- XML文件读取数据绑定到DropDownList
- CascadingDropDown从数据库中读取数据绑定到DropDownList控件上
- asp.net ajaxtoolkit CascadingDropDown从数据库中读取数据绑定到DropDownList控件上
- CascadingDropDown从数据库中读取数据绑定到DropDownList控件上
- DropDownList控件的使用(数据绑定)
- DropDownList控件的使用(数据绑定)
- DropDownList 控件 可编辑 查询 绑定数据
- DropDownList控件的数据绑定方式
- asp:DropDownList动态绑定数据,设置默认值
- asp.net DropdownList分组下拉树控件 动态绑定后台数据
- Copy LinkedList With Arbitrary Node
- 古今之成大事业、大学问者,必经过三种之境界
- Thinkpad T400 Fan error报错非风扇问题解决一例
- Java IO--数据操作流DataOutputStream/DataInputStream
- 如何得到JDBC Insert 语句执行后插入Oracle 数据库记录的主键
- dropDownList 控件动态绑定数据和读取
- AD域管理
- Hibernate 映射文件 inverse整理
- Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
- sap用户有效期修改
- 私有成员变量的理解
- SVD分解的理解
- 注册表启动项
- oracle 面试题下 (七) rownum的运用