1. 程式人生 > >repeat迴圈繫結ItemDataBound .

repeat迴圈繫結ItemDataBound .

 protected void rptproclass_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label menuid = (Label)e.Item.FindControl("lblid");
                string menuids = menuid.Text.ToString();
                DataTable pro = TOPRAND.COMMON.StaticFunction.getData("select  top 4 * from K_Product where left(menuid,8) ='" + menuids + "' and len(menuid)>8 and IsPub=1");
                Repeater repproduct1 = (Repeater)e.Item.FindControl("repproserver");
                repproduct1.DataSource = pro;
                repproduct1.DataBind();
            }
        }