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>
开发者_Python百科 </tr>
</ItemTemplate>
</asp:Repeater>
You cant set the datasource for the item template, you can set it for the repeater in the code behind using
rptTotal.DataSource = datasourcename
精彩评论