我现在要用两个dropdownlist来做,怎么实现联动呢?
淘宝新到货: http://shop36082390. 电脑及配件/杀毒U盘/移动硬盘/减肥产品/切苹果器/剥蒜器/个性烟灰缸/装饰彩灯/雨伞/女包//手机座/极品铁观间茶叶/五层布衣柜/三洋/日立投影机
QQ:410243392 (常用)
绑定到一起:
string sqlstr = "select typename as 'aaa' from type union select productname as 'aaa' from list";
SqlConnection myconn = new ...........
SqlDataAdapter da = new SqlDataAdapter(sqlstr,myconn);
DataSet ds = new DataSet();
da.Fill(ds);
this.DropDownList1.DataSource = ds;
this.DropDownList1.DataTextField = "aaa";
this.DropDownList1.DataValueField = "aaa";
this.DropDownList1.DataBind();
分开做.你就在第一个的DropDownList的SelectedIndexChanged 事件里面写上相应的代码就行了.