<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1"
            DataTextField="fenlei" DataValueField="fenlei">
            <asp:ListItem Value="新加项1">新加项1</asp:ListItem>
<asp:ListItem Value="新加项2">新加项2</asp:ListItem>
<asp:ListItem Value="新加项3">新加项3</asp:ListItem>
        </asp:DropDownList>为什么不显示 “新加项”呢?!

解决方案 »

  1.   

    <asp:DropDownList   ID="DropDownList1"   runat="server"   DataSourceID="SqlDataSource1"
                         >
                            <asp:ListItem   Value="1"> 新加项1 </asp:ListItem>
    <asp:ListItem   Value="2"> 新加项2 </asp:ListItem>
    <asp:ListItem   Value="3"> 新加项3 </asp:ListItem>
                    </asp:DropDownList>这样就可以了
      

  2.   

    加:AppendDataBoundItems="True" 试试        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1"
                DataTextField="fenlei" DataValueField="fenlei" AppendDataBoundItems="True">
                <asp:ListItem Value="新加项1"> 新加项1 </asp:ListItem>
                <asp:ListItem Value="新加项2"> 新加项2 </asp:ListItem>
                <asp:ListItem Value="新加项3"> 新加项3 </asp:ListItem>
            </asp:DropDownList>
      

  3.   

    可能是数据绑定后,将原来的数据覆盖了。
    在后台这样:
    //数据绑定
    DropDownList1.Items.Insert(0,new ListItem("DataTextField的数值","DataValueField的数值"));
    DataTextField的数值和DataValueField的数值这两个如果不对的话,调换位置!
      

  4.   

    上面ListItem如果不对的话,改成ItemList。
    哈哈,记不太清了,请楼主多多尝试,多多包含。
    上面的方法肯定能用!
      

  5.   

    cattv 正解
    ------------CSDN竹子专享签名功能----------------------------------------------------------------------------------------------------------
    ◆如果问题解决,请结贴,谢谢!
    ◆不知道怎么结贴?请单击我
    ◆如有仍有其它问题,请继续顶贴。
    ◆表跟竹子要QQ,不开QQ已经好几年了,改用Google Talk。
    -----------------------------------------------------------------------------------------------------------------------------------------