I want to bind a data source to a GridView, but it does not work because the data source is dynamic, who can give me a hand? Thanks!
/ **** C # ******* /
List<dynamic> dyList = new List<dynamic>(); dynamic info1 = new ExpandoObject(); info1.FFID = 1; info1.Name = "Bill1"; dynamic info2 = new ExpandoObject(); info2.FFID = 2; info2.Name = "Bill2"; dyList.Add(info1); dyList.Add(info2); Repeater1.DataSource = dyList; Repeater1.DataBind();
/ **** aspx ******* /
<asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <%# Eval("FFID") %> <%# Eval("Name") %> </ItemTemplate> </asp:Repeater>
Can't find ffid and name, why?
source share