如何知道DropDownList选择Item的,此时DataValueField的值是多少?
such as :
DropDownList1.DataTextField = "Name";
DropDownList1.DataSource = dm.SetAClassIndex();
DropDownList1.DataValueField = "classID";
DropDownList1.DataBind();
when select I want to know the ture classID value.
Thanks for any help.
DropDownList1.DataTextField = "Name";
DropDownList1.DataSource = dm.SetAClassIndex();
DropDownList1.DataValueField = "classID";
DropDownList1.DataBind();
when select I want to know the ture classID value.
Thanks for any help.
...全文
相关推荐
用javascript为DropDownList控件下拉式选择添加一个Item至定义索引位置
- 设置新创建的option元素的文本(`text`属性)和值(`value`属性)。 - 使用`insertBefore()`方法将新的option元素插入到指定位置。
DropDownList控件绑定数据源的三种方法
DropDownList控件在Web开发中经常用于创建下拉列表,让用户从预定义的选项中进行选择。
asp.net中不能在DropDownList中选择多个项 原因分析及解决方法
在ASP.NET中,DropDownList控件通常用于呈现一组可选项,让用户从中选择一个单选值。
(asp.net c#)DropDownList绑定后显示对应的项的两种方法.docx
== "i") { DropDownList1.SelectedIndex = i; break; }}```在上面的代码中,我们使用 for 循环来遍历 DropDownList 中的所有项,然后判断当前项的值是否等于我们要显示的项
DropDownList下拉菜单显示不同图片
**事件处理**:我们需要监听DropDownList的SelectedIndexChanged事件,当用户选择新项时,该事件会被触发。在事件处理程序中,我们可以根据选中的值来改变图片的显示。


