DropDownList 控件用于创建下拉列表。

DropDownList 控件中的每个可选项都是由 ListItem 元素定义的!

该控件支持数据绑定!

  DropDownList1.DataSource = querydata;//指定数据源
        DropDownList1.DataBind();//数据源绑定
        //DropDownList1.Items.Insert(0,new ListItem("请选择单位"));
     
        DropDownList1.DataTextField = "AreaName";//界面上显示的是地名
        DropDownList1.DataValueField = "AreaCode";//存的是地区编号
     

 

相关文章: