In ASP: ListView, I want to pass the entire object to a child in an ItemTemplate, not just one 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 The DocumentHeader expects the entire Document object, while the Body is the Document property.
Obviously, I could just create a new property in the document or use the LINQ query to generate a new class with the desired property. I just want to know if there is a simpler and more direct way to get what I want.
spaetzel
source share