I've never had to do this, but I'm binding a repeater to a generic list of Strings, and I'm not sure of the correct syntax.
If I was binding to an IList and myType had a property LayerName I'd use this:
<asp:Repeater ID="rptChecks" runat="server">
<ItemTemplate>
<input type="checkbox" id="<%#Eval("LayerName") %>"/>
</ItemTemplate>
</asp:Repeater>
How can I do this when I'm only binding to a String which does not have any properties to use?
Try this:
<asp:Repeater ID="rptChecks" runat="server">
<ItemTemplate>
<input type="checkbox" id="<%# Container.DataItem %>"/>
</ItemTemplate>
</asp:Repeater>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With