日期:2014-05-17 浏览次数:20552 次
<Caicai:CRepeater ID="CRepeater1" runat="server"> <ItemTemplate> <h1> <%# Eval("id")%> </h1> <span> <%# Eval("name")%> </span> <Caicai:CRepeater ID="CRepeater2" runat="server"> <ItemTemplate> <h2> <%# Eval("id")%> </h2> <span> <%# Eval("name")%> </span> </ItemTemplate> </Caicai:CRepeater> </ItemTemplate> </Caicai:CRepeater>
------解决方案--------------------
推荐非反射
假如你绑定的数据源是 DataTable/DataView/DataSet
<%# ((Container.NamingContainer.NamingContainer as RepeaterItem).DataItem as DataRowView)["name"] %>
实体类
<%# ((Container.NamingContainer.NamingContainer as RepeaterItem).DataItem as MyEntity).TheNameProperty %>