Let's say I have this class:
public class Student {
private string _name;
private int _id;
public string Name
{
}
public int ID
{
}
}
I want to link it, say FormView
<asp:FormView runat="server" ID="FormView1">
<ItemTemplate>
<asp:Label runat="server" id="lblName" Text="<% Eval('Name') %>" />
</ItemTemplate>
</asp:FormView>
However, when I try to do
FormView1.DataSource = student;
I will get an error saying that I need to implement iListSource, iEnumerable or IDataSource.
I do not know if IListSource and IEnumerable are applicable, and I cannot find a good example of how to implement IDataSource.
This is for asp.net.
source
share