商务合作:179001057@qq.com

嵌套Repeater,获取父级Repeater值

技术2022-05-11  0


某平台价值19860元的编程课程资料免费领取【点我领取】


嵌套Repeater,获取父级Repeater值  

<asp:Repeater ID="Repeater1" runat="server">      <ItemTemplate>         OrderID: <%# Eval("OrderID")%>        CustomerID :          <asp:Label ID="Label1" runat="server" Text='<%#Eval("CustomerID")%>'></asp:Label> <br />        <asp:Repeater ID="Repeater2" runat="server" DataSource='<%# GetOrderDetails(Convert.ToInt32(Eval("OrderID"))) %>'>             <ItemTemplate>                  &nbsp;&nbsp;                子容器得到CustomerID : <%# ((Label)((RepeaterItem)((Repeater)(((RepeaterItem)Container).NamingContainer)).NamingContainer).FindControl("Label1")).Text %>                 UnitPrice: <%#Eval("UnitPrice")%> <br />            </ItemTemplate>         </asp:Repeater>         <br />                      </ItemTemplate> </asp:Repeater>


最新回复(0)