比如
<asp:DropDownList ID="dropBeginYear" runat="server">
<asp:ListItem Value="2006">2006</asp:ListItem>
<asp:ListItem Value="2007">2007</asp:ListItem>
<asp:ListItem Value="2008">2008</asp:ListItem>
<asp:ListItem Value="2009">2009</asp:ListItem>
<asp:ListItem Value="2010">2010</asp:ListItem>
</asp:DropDownList>页面打开是默认就选中了2006 
问题是我不希望打开时dropdownlist里有值,空着就行
该如何处理
大家帮忙,谢谢!!

解决方案 »

  1.   

    意思就是默认是null         空
    选择时候下拉表里显示出来  2006   
                              2007
                              2008
      

  2.   

    DropDownList1.Items.Add(new ListItem("",""));
      

  3.   

    建一个item,text="请选择" Value=""
    验证这个不能为空,试试
      

  4.   

    孟老大写的是正确的
    或者你在<asp:ListItem Value="2006">2006</asp:ListItem>加一句<asp:ListItem Value=""></asp:ListItem>不就行了?
      

  5.   

    那样你要自己重写dropdownlistbox了
      

  6.   

    DropDownList1.Items.Add(new ListItem("",""));绑定完之后这样写就行了.
      

  7.   

    DropDownList1.Items.Add(new ListItem("",""));
      

  8.   

    DropDownList1.Items.Add(new ListItem("","value"));value最好加个值
      

  9.   

    DropDownList1.Items.Remove(DropDownList1.Items.FindByText(""));
      

  10.   

    DropDownList1.Items.Remove(DropDownList1.Items.FindByText(""));
    DropDownList1.Items.Add(new ListItem("",""));是添加,还是删除都可以,还吧明白么?
      

  11.   

    DropDownList1.Items.Remove(DropDownList1.Items.FindByText(""));
    DropDownList1.Items.Add(new ListItem("",""));是添加,还是删除都可以,你还不明白么?
      

  12.   

    //    DropDownList1.Items.Insert(0, new ListItem("请选择------------空", ""));//第一行值默认为空"%"
      

  13.   

    呵呵,不至于那么麻烦
    谢谢各位的帮忙,特别是  net_lover(【孟子E章】 有钻石 的高人