假设我有一个看起来像这样的类结构:
public class A
{
public string Poperty1 { get; set; }
public string Poperty2 { get; set; }
public List<B> Property3 { get; set; }
}
public class B
{
public string Property4 { get; set; }
public string Property5 { get; set; }
}
...和几个看起来像这样的嵌套中继器:
<asp:Repeater ItemType="A" runat="server">
<ItemTemplate>
<asp:Label Text="<%# Item.Property1 %>" runat="server" />
<asp:Repeater runat="server" DataSource="<%# Item.Property3 %>" ItemType="B">
<ItemTemplate>
<asp:Label Text="<%# Item.Property4 %>" runat="server" />
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
如何从第二个中继器访问 Property2?