DropDownList1.Items.Insert(0, new ListItem("全部", "0"));不仅要给Text,还要给Value

解决方案 »

  1.   

    如果没有的话用TextBox+DropDownList,我是用这两个控键写了一个新的控键,以后用就方便了
      

  2.   

    DropDownList 控件 的下拉列表中 有 A、B、C 三个选项,
    如果
     protected void Page_Load(object sender, EventArgs e)
        {
            DropDownList.Text = "A" //没问题,
         }但
      protected void Page_Load(object sender, EventArgs e)
        {
            DropDownList.Text = "D" 就出问题,因为 D 不是 下拉列表中的数据
         }
    D 是从数据库取出来的值
      

  3.   


    解决了try
    {
                DropDownList.Text = "D"
            }
            catch 
            {
               
            }
      

  4.   

    DropDownList 的数据从数据库先绑定出来
    然后在可以在DropDownList显示出来的最上面可以显示“请选择” 下面跟数据   DropDownList1.Items.Add("请选择","0");
      

  5.   

    if (DropDownList1.Items.FindByText("D"))
    {
      DropDownList.Text = "D";
    }