asp.net中dropdownlist中绑定数据…
来源:互联网 发布:php属于编程语言 编辑:程序博客网 时间:2024/05/22 14:23
我用sqldatasource插件给dropdownlist绑定了数据源,
数据根据RadioButtonList中的选项来显示,代码如下
if (!IsPostBack)
{
this.DropDownList1.Items.Clear();
this.DropDownList1.AppendDataBoundItems = true;
this.DropDownList1.Items.Add(new ListItem("=请选择=", "=请选择="));
this.DropDownList1.DataValueField = "Kind2";
this.DropDownList1.DataTextField = "Kind2";
this.DropDownList1.DataSourceID = "SqlDataSource1";
this.DropDownList1.DataBind();
}
可问题是,每次改变RadioButtonList中的选项后,DropDownList中的数据项就会再次被加入,不同RadioButtonList对应的数据项都显示出来了,还刷新一次就加一次,导致出现重复的项,怎样在不删除“=请选择=”这个项的前提下,解决上面的问题。能给出代码最好
数据根据RadioButtonList中的选项来显示,代码如下
if (!IsPostBack)
可问题是,每次改变RadioButtonList中的选项后,DropDownList中的数据项就会再次被加入,不同RadioButtonList对应的数据项都显示出来了,还刷新一次就加一次,导致出现重复的项,怎样在不删除“=请选择=”这个项的前提下,解决上面的问题。能给出代码最好
0 0
- asp.net中dropdownlist中绑定数据…
- ASP.NET中利用存储过程向DropDownList中绑定数据
- ASP.net中在gridview中绑定dropdownlist控件
- asp.net中DropDownList动态加载数据
- ASP.NET中dropdownlist 动态绑定数据的二种方法
- asp.net ajaxtoolkit CascadingDropDown从数据库中读取数据绑定到DropDownList控件上
- ASP.NET中DropDownList控件的数据绑定的C#语言描述
- 绑定access数据库,asp.net 中 以DropDownList为查询条件 ,前台实现数据查询
- asp.net中dropdownList绑定已有信息
- ASP.NET MVC 八 DropDownList数据绑定
- 《ASP.NET》数据绑定—DropDownList、ListBox
- .Net中结合iBatisNet查询的DropDownList数据绑定
- ASP.NET中DropDownList控件的简单使用--DDL绑定数据库表中值,选择DDL中值直接检索数据
- ASP.NET中DropDownList控件的简单使用--DDL绑定数据库表中值,选择DDL中值直接检索数据
- asp.net中数据绑定的写法
- 在ASP.NET中绑定XML数据
- DataGrid中DropDownList 的数据绑定
- DataGrid中DropDownList 的数据绑定
- Adobe photoshop cs5,dreamweaver …
- 1417: 为了未来的计算机
- Adobe Dreamweaver CS5安装jQuery…
- C#泛型-泛型集合Dictionary
- C#中Dictionary的用法
- asp.net中dropdownlist中绑定数据…
- DropdownList控件动态绑定数据源两…
- c#中分割字符串的几种方法
- 判断字符串是否含有指定子字符串 -…
- adobe dreamweaver cs5序列号不对,…
- Office OneNote 2007 是一个数字笔记本
- js事件列表
- Js事件大全
- C#判断一个string是否为数字(正则…