protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Repeater rp = e.Item.FindControl("Repeater2") as Repeater; DataRowView rowv = (DataRowView)(e.Item.DataItem); //提取分类ID string CategorieId = Convert.ToString(rowv["ClassId"]); //根据分类ID查询该分类下的产品,并绑定产品Repeater DataSet ds = tcBLL.GetList("ClassPre='" + CategorieId + "'"); rp.DataSource = ds.Tables[0].DefaultView; rp.DataBind(); rp.Dispose(); ds.Dispose(); } }
转载于:https://www.cnblogs.com/Setme/archive/2012/06/05/2537140.html