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();
}
}
}
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();
}
}
}
作者:拒绝潜水的鱼
出处:http://slave2.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
出处:http://slave2.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。