前台使用的一个repeater(ID=repeater1),后台绑定如下:
List<Contact> contacts=null;
//获取contact数据
this.repeater1.DataSource=contacts;
this.repeater1.DataBind();
Contact类中有两个属性,int ID; Profile profile;
Profile类中有一个属性,string disName;在前台如何用Eval绑定输出 disName对应的值?
List<Contact> contacts=null;
//获取contact数据
this.repeater1.DataSource=contacts;
this.repeater1.DataBind();
Contact类中有两个属性,int ID; Profile profile;
Profile类中有一个属性,string disName;在前台如何用Eval绑定输出 disName对应的值?
Eval("profile.disName")
<%# Eval("字段名") %>
<%#Eval("profile.disName")%>绑定 profile对象的属性disName