<anthem:Repeater ID="repeater1" runat="server" AutoUpdateAfterCallBack="True">
<ItemTemplate>
<ol>
<h5 class="h5">
</h5>
<dt>咨询人名字:<%# Eval("GUserName")%> <span class="sy4">留言时间:<%# Eval("GTime")%></span></dt>
<dd>
留言内容:<%#Eval("Gcontent") %></dd>
<dd>
回复:</dd>
<anthem:Repeater ID="Repeater2" runat="server">
<ItemTemplate>
<ol>
<dt>咨询人名字:<%# Eval("Lname")%> <span class="sy4">回复时间:<%# Eval("Ltime")%></span> 联系:<%#Eval("Gcontent") %></dt>
<dd>回复内容:<%#Eval("Lcontent")%></dd>
</ol>
</ItemTemplate>
</anthem:Repeater>
</ol>
</ItemTemplate>
</anthem:Repeater>
注册Repeater1的DataItemBound事件,在事件中编写如下代码:
protected void Repeater1_DataItemBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater repeater2 = e.Item.FindControl("Repeater2") as Repeater;
if (repeater2 != null)
{
repeater2.DataSource = yourDataSource;
repeater2.DataBind();
}
}
}