In my codebehind im filling a repeater with this class:
public class Reference
{
public string PageType;
public string Url;
public string Name;
}
And this code:
var NewReference = new Reference();
NewReference.Name = "Hello World"
TheList.Add(NewReference);
TheRepeater.DataSource = TheList;
TheRepeater.DataBind();
How do I get the “Name”, “PageType” and “Url” in the webform?
I tried:
<%# Eval("Name") %>
With no luck…
As first step – ensure that code which fills in
DataSourceexecutes (just put a breakpoint).Try out putting it in label
Also you can add more formatting if needed
For more details see MSDN Data-Binding Expressions Overview