I am binding a List<string>
to a Repeater control. Now I want to use the Eval
function
to display the contents in ItemTemplate
like
<%# Eval("NAME") %>.
But I am not sure what I should use instead of NAME.
I am binding a List<string>
to a Repeater control. Now I want to use the Eval
function
to display the contents in ItemTemplate
like
<%# Eval("NAME") %>.
But I am not sure what I should use instead of NAME.
A more complete example based on the LINQ provided by @RobertoBr:
In code behind:
On page:
This should work just fine:
in the repeater you put
Set the ItemType to System.string
you have to use the databing syntax here or it will not work.
Inside Item Template
or Simply Add inside Item Template