对每个Dropownlist都
SqlCommand cmd=new SqlCommand("select id,name from yourtable",con);
SqlDataReader dataReader=cmd.ExecuteReader();
DropDownList1.DataSource=dataReader;
DropDownList1.DataTextField="name";
DropDwonList1.DataValueField="id";
DropDwonList1.DataBind();
con.Close();
吗????

解决方案 »

  1.   

    不是吧??有上百个DropDownList??这样你的页面的负担太重了
      

  2.   

    我的页面上最多的有十一个dropdownlist控件呀,用起还是可以呀不过呢,如果在dropdownlist中的数据过多的话,页面的负担感觉好像有点重了这就要求我们对其绑定的数据读取的时候进行优化了。:)
      

  3.   

    对于每个Dropownlist都写
    SqlCommand cmd=new SqlCommand("select id,name from yourtable",con);
    SqlDataReader dataReader=cmd.ExecuteReader();
    DropDownList1.DataSource=dataReader;
    DropDownList1.DataTextField="name";
    DropDwonList1.DataValueField="id";
    DropDwonList1.DataBind();
    con.Close();
    显然很不好了.但是我想不到其他什么办法啊
      

  4.   

    恐怕只能分拆成多个页面了,不然viewstate就让你无法忍受!期待高手给出更好的方案:)