Repeater嵌套的注意事项

Repeater嵌套的注意事项
  protected void rptProductCategoryOne_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                int cid = int.Parse(DataBinder.Eval(e.Item.DataItem, "CategoryId").ToString());
                QueryParam qp = new QueryParam();
                qp.Where = " where parentid=" + cid;
                int recordCount = 0;
                ArrayList lst = BusinessFacade.app_ProductCategoryList(qp, out recordCount);
                if (recordCount > 0)
                {
                    Repeater LeftSubID = (Repeater)e.Item.FindControl("rptProductCategoryTwo");//使用FindControl
                    LeftSubID.DataSource = lst;
                    LeftSubID.DataBind();
                }
            }
        }
posted @ 2008-03-21 01:28  拒绝潜水的鱼  阅读(352)  评论(0编辑  收藏  举报