I’m trying to understand how Eval() works for a specific purpose. I’m working on a project I don’t really know and I need to read some data and put them in drop down list. These data are already read and are displayed inside an ItemTemplate. I noticed there are read using the Eval() method.
Something like:
<ItemTemplate>
<a href="...=<%# Eval("foo") %>></a>
</ItemTemplate>
I need to know where Eval is getting these data from in order to discover where I should read them for my drop down list! But I didn’t really understand how it works!
I know that Eval() evaluates data binding expressions at runtime but where do you think I should take a look at?
Thank you
This is a good resource: http://bytes.com/topic/asp-net/answers/447041-databinder-eval-mystification
Some reasons why to avoid it: http://weblogs.asp.net/jgalloway/archive/2005/09/20/425687.aspx
One way to improve by explicit cast: http://dotnettipoftheday.org/tips/use-explicit-casting-instead-of-databinder.eval.aspx
HTH.