If I have objects in my DataSource i.e
.Select(e => new { Foo = new { Bar = "HelloWorld" }, Price = 12345 }
how do I reference this using Eval?
<%# Eval("Foo.Bar") %>
doesn’t work? (Eval(“Price”) does….)
Is there anyway to do <%# Eval(Eval(“Foo”),”Bar”) %> or something ?
If this is in reference to a DataBound control where you’re binding to some List or anonymous IQueryable, you should be able to use
Eval("Bar")since the Foo is already indicated in the bind.Edit:
Looking at your update, if you want to use the
<%# %>notation, you might be able to get away with it by usingContainer.DataItem.