三重相互关联的Repeater嵌套,怎样绑定数据源? 在做一个答题的程序,答题页面有分组,分组内有该分组的题目,题目内有该题目的选项;都是使用Repeater空间来实现。现在可以绑定分组和题目的数据源,怎么样绑定选项的信息?谢谢、、 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 基础问题要自己动手做的findcontrol()然后绑定具体自己试下了 终于解决了,当时做的时候想太多了,其实挺简单的, //绑定分组信息 repGroupList.DataSource = GroupManager.GetGroupList(qnId); repGroupList.DataBind(); //绑定分组信息时,绑定题目信息 protected void repGroupList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Group group = (Group)e.Item.DataItem; Repeater repQuestionList = (Repeater)e.Item.FindControl("repQuestionList"); repQuestionList.DataSource = QuestionManager.GetQuestionListByGroupId(group.GroupId); repQuestionList.DataBind(); } } //绑定题目信息时,绑定选项信息 protected void repQuestionList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Question question = (Question)e.Item.DataItem; Repeater repOptionList = (Repeater)e.Item.FindControl("repOptionList"); repOptionList.DataSource = OptionManager.GetOptionsByQId(question.QId); repOptionList.DataBind(); } } 怎么遍历datalist 有没有什么类似button的控件选择 但是不刷新页面? ASP.NET程序能不能自动发布到FTP 为什么socket.Available老是为0 请大家帮我看看这个是什么问题 asp.net里如何实现向在线客户端消息? 用过MagicAjax的帮忙 在asp.net中如何应用css样式表???(新手上战利路) 怎么判断导入数据类型是否正确呢? 解决方案资源管理器的自动隐藏人间蒸发了 asp.net jquery.validate+ASP.NET怎么做验证?
repGroupList.DataSource = GroupManager.GetGroupList(qnId);
repGroupList.DataBind(); //绑定分组信息时,绑定题目信息
protected void repGroupList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
Group group = (Group)e.Item.DataItem; Repeater repQuestionList = (Repeater)e.Item.FindControl("repQuestionList");
repQuestionList.DataSource = QuestionManager.GetQuestionListByGroupId(group.GroupId);
repQuestionList.DataBind();
}
} //绑定题目信息时,绑定选项信息
protected void repQuestionList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
Question question = (Question)e.Item.DataItem; Repeater repOptionList = (Repeater)e.Item.FindControl("repOptionList");
repOptionList.DataSource = OptionManager.GetOptionsByQId(question.QId);
repOptionList.DataBind();
}
}