以前 都能把DROPDOWNLIST 帮定出来后 然后加一个 请选择
我现在是加了个弹出层 也帮定出来了 但怎么加一个 请选择 不显示了呢<div style="width:75px;float:left;height:75px;margin:0px 0px 0px 0px;text-align:center;">
        <div style="width:100%;height:19px;font-size:13px;">所在街道:</div>
        <div style="width:100%;height:19px;font-size:13px;"><asp:DropDownList ID="streetdropdown" Width="70px" runat="server" DataTextField="hw_street" DataValueField="hw_street" font-size="8pt"  ></asp:DropDownList></div>
        <div style="width:100%;height:19px;font-size:13px;">所属类别:</div>
        <div style="width:100%;height:18px;font-size:13px;"><asp:DropDownList ID="detailtypedropdown" Width="70px" runat="server" DataTextField="detailtype" DataValueField="detailtype" font-size="8pt" ></asp:DropDownList></div>
 </div>
后台:
           streetdropdown.DataSource = CatalogAccess.Getcxstreet(jm_hw_user_id);
            streetdropdown.DataBind();
            this.streetdropdown.Items.Insert(0, new ListItem("请选择", ""));  怎么最后这句不起作用

解决方案 »

  1.   

    streetdropdown.DataSource = CatalogAccess.Getcxstreet(jm_hw_user_id);
    streetdropdown.Items.Insert(0, new ListItem("请选择", "")); 
    streetdropdown.DataBind();先insert再DataBind。
      

  2.   

    本帖最后由 net_lover 于 2011-05-10 21:59:34 编辑
      

  3.   

    本帖最后由 net_lover 于 2011-05-10 21:59:55 编辑
      

  4.   

    静态添加一个item然后把AppandBataBoundItems属性为ture.
      

  5.   

    streetdropdown.DataSource = CatalogAccess.Getcxstreet(jm_hw_user_id);
    streetdropdown.DataBind();
    streetdropdown.Items.Insert(0, new ListItem("请选择", ""));   这个没有请选择
    streetdropdown.AppendDataBoundItems = true;
    streetdropdown.Items.Add(new ListItem("-- 请选择 --", ""));
    streetdropdown.DataSource = CatalogAccess.Getcxstreet(jm_hw_user_id);
    streetdropdown.DataBind();
    这摸做 帮定的数据是双分显示怎么回事啊
      

  6.   

    实在不行的话你动太去添加每一项,先在数据源foreach前面就加上
    streetdropdown.Items.Add(new ListItem("-- 请选择 --", ""));
    然后在循环添加每一项试一下,或者前面你还可以加一个streetdropdown.Clear();
    页面多次提交