在.net中两个Repeater嵌套的时候怎样获得里面个Repeater里的控件啊?
1个回答
2013-10-21
展开全部
protected void 外边的Repeater_ItemDataBound(object sender, RepeaterItemEventArgs e){ if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater rep = e.Item.FindControl("里面的Repeater") as Repeater;//找到里层的repeater对象
DataRowView rowv = (DataRowView)e.Item.DataItem;//找到分类Repeater关联的数据项
int typeid = Convert.ToInt32(rowv["qtid"]); //获取填充子类的id
rep.DataSource = LiftQuestionCtr.GetSomeQuestionsByTypeid(typeid, 2);
rep.DataBind();
}
}
{
Repeater rep = e.Item.FindControl("里面的Repeater") as Repeater;//找到里层的repeater对象
DataRowView rowv = (DataRowView)e.Item.DataItem;//找到分类Repeater关联的数据项
int typeid = Convert.ToInt32(rowv["qtid"]); //获取填充子类的id
rep.DataSource = LiftQuestionCtr.GetSomeQuestionsByTypeid(typeid, 2);
rep.DataBind();
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询