我想将数据源绑定到GridView,但它不起作用,因为数据源是动态的,谁能帮我一把?谢谢!
/ * *** 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>
找不到 FFid 和名称,为什么?