I need some help in understanding what the Eval bit does (Just started learning C#.net):
<asp:Image
ID="Image1"
ImageUrl='<%# Eval("Name", "~/UploadImages/{0} %>'
...
The image is in a datalist repeater which has been binded to a folder containing images files.
I’m confused with the “Name” and {0}.. what is the significance of these and in what situation can I change them.
The Eval statement in an aspx or ascx file is usually used to dynamically evaluate a binding statement within the context of the item bound to the current row in a databound control.
The first parameter is the property/field to bind to on the row. The second parameter is an optional format string. {0} will be replace with the value of the Name property in rendering the output text.
Here’s the relevant doc. Enjoy!