repeater中嵌套repeater的问题
前台<asp:RepeaterID="Repeater1"runat="server"OnItemDataBound="Repeater1_ItemDataBound">...
前台
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate>
<%# Eval("title")%>
<%--嵌套一个Repeater5--%>
<asp:Label ID="lbl_IDD" runat="server" Text='<%# Eval("id") %>' Visible="False"></asp:Label>
<asp:Repeater ID="Repeater5" runat="server" >
<ItemTemplate>
<%-- <hr width="100%" size="1" color="#CCCCCC">--%>
<fieldset>
<%#Eval("title")%>
</fieldset>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
后台
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
successclassbll scb = new successclassbll();
successbll sb = new successbll();
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater Repeater5_CS = null;
Label PD_IDD_CS = new Label();
Repeater5_CS = (Repeater)e.Item.FindControl("Repeater5");
if (Repeater5_CS != null)
{
PD_IDD_CS = (Label)e.Item.FindControl("lbl_IDD");
Repeater1.DataSource = scb.successclass_all();
Repeater1.DataBind();
Repeater5_CS.DataSource = sb.success_all_cid(Convert.ToInt32(PD_IDD_CS));
Repeater5_CS.DataBind();
}
}
}
怎么没数据显示啊! 展开
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate>
<%# Eval("title")%>
<%--嵌套一个Repeater5--%>
<asp:Label ID="lbl_IDD" runat="server" Text='<%# Eval("id") %>' Visible="False"></asp:Label>
<asp:Repeater ID="Repeater5" runat="server" >
<ItemTemplate>
<%-- <hr width="100%" size="1" color="#CCCCCC">--%>
<fieldset>
<%#Eval("title")%>
</fieldset>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
后台
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
successclassbll scb = new successclassbll();
successbll sb = new successbll();
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater Repeater5_CS = null;
Label PD_IDD_CS = new Label();
Repeater5_CS = (Repeater)e.Item.FindControl("Repeater5");
if (Repeater5_CS != null)
{
PD_IDD_CS = (Label)e.Item.FindControl("lbl_IDD");
Repeater1.DataSource = scb.successclass_all();
Repeater1.DataBind();
Repeater5_CS.DataSource = sb.success_all_cid(Convert.ToInt32(PD_IDD_CS));
Repeater5_CS.DataBind();
}
}
}
怎么没数据显示啊! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询