J
Joe Fawcett
Sorry about the multi post, I thought I'd sent to both groups simultaneously but
somehow it failed to find this one the first time.
I'm having a problem binding an asp:repeater control to a Hashtable. Originally
my code was:
<asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Key") %> =
<%# DataBinder.Eval(Container.DataItem, "Value") %>
</ItemTemplate>
</asp:Repeater>
which was bound to a Hashtable and all works fine. I then started reading that
Databind.Eval was an overkill, I could just use:
<asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>">
<ItemTemplate>
<%# Container.DataItem.Key %> =
<%# Container.DataItem.Value %>
</ItemTemplate>
</asp:Repeater>
but although I can build the site when accessing the page I get an error that :
'object' does not contain a definition for 'Key'
pointing to the first changed line. I've found lots of examples on the Web
showing this second version, are they all perhaps from a beta version or is it
something else?
Thanks
somehow it failed to find this one the first time.
I'm having a problem binding an asp:repeater control to a Hashtable. Originally
my code was:
<asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Key") %> =
<%# DataBinder.Eval(Container.DataItem, "Value") %>
</ItemTemplate>
</asp:Repeater>
which was bound to a Hashtable and all works fine. I then started reading that
Databind.Eval was an overkill, I could just use:
<asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>">
<ItemTemplate>
<%# Container.DataItem.Key %> =
<%# Container.DataItem.Value %>
</ItemTemplate>
</asp:Repeater>
but although I can build the site when accessing the page I get an error that :
'object' does not contain a definition for 'Key'
pointing to the first changed line. I've found lots of examples on the Web
showing this second version, are they all perhaps from a beta version or is it
something else?
Thanks