Get the current bounded object in a ListView's ItemTemplate

Posted by Andreas Grech on Stack Overflow See other posts from Stack Overflow or by Andreas Grech
Published on 2010-03-14T12:49:53Z Indexed on 2010/03/14 12:55 UTC
Read the original article Hit count: 469

Filed under:
|
|
|

I want to be able to get the current bound object in the ItemTemplate of a ListView control.

Here's an example of what I want to do:

<asp:ListView ID="UserList" runat="server">
    <LayoutTemplate>
        <asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
    </LayoutTemplate>
    <ItemTemplate>
        //How can I get the current bound object in here?
    </ItemTemplate>
</asp:ListView>

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#