chobo
chobo

Reputation: 32311

How to set <ItemTemplate> to a datasource?

How can I set the datasource of an ItemTemplate? Right now I have one that is wrapped by a datarepeater and that is how I databind to it.

 <asp:Repeater ID="rptTotal" runat="server">
        <ItemTemplate>
            <tr>
                <td>One</td>
            <td>Two</td>
            <td>Three</td>
            <td>Four</td>
                </tr>
        </ItemTemplate>
</asp:Repeater>

Upvotes: 0

Views: 687

Answers (1)

atrljoe
atrljoe

Reputation: 8151

You cant set the datasource for the item template, you can set it for the repeater in the code behind using

rptTotal.DataSource = datasourcename

Upvotes: 2

Related Questions