repeater的头里有个DropDownList
<HeaderTemplate><div> <asp:DropDownList runat="server"></asp:DropDownList></div>
<HeaderTemplate>我在后台像平常一样绑定DropDownList好像不行,怎么绑定DropDownList?

解决方案 »

  1.   

    在itemdatabound事件里面写就OK了!        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
            {
                if(e.Item.ItemType == ListItemType.Item)
                {
                DropDownList drp = e.Item.FindControl("dropdownlist") as DropDownList;
                drp.DataSource=;
                drp.DataBind();
                }
            }
      

  2.   

    ItemDataBound事件里写
    1楼的就可以了
      

  3.   

     protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
            {
                if(e.Item.ItemType == ListItemType.Item)
                {
                DropDownList drp = e.Item.FindControl("dropdownlist") as DropDownList;
                drp.DataSource=;
                drp.DataBind();
                }
            }
    正解