In an ASP:ListView I want to pass an entire object to a child control within the ItemTemplate, not just a single property of the current object.
Here is the code I want to work:
<asp:ListView ID="answers" runat="server">
<LayoutTemplate>
<div id="itemPlaceholder" runat="server" />
</LayoutTemplate>
<ItemTemplate>
<div>
<uc2:DocumentHeader runat="server" Document="Eval(%# Eval("this") %> />
<p><%# Eval("Body") %></p>
</div>
</ItemTemplate>
</asp:ListView>
The Document property of the DocumentHeader expects the entire Document object, whereas "Body" is a property of Document.
Obviously, I could just create a new property within Document or use a LINQ query to generate a new class with the property I want, I just want to know if there is an easier, more direct way to get what I want.