在网上查了很久没查到repeater的倒序 尽是一些忽悠人的 好了 回到正题咯
.cs 文件里面
protected void LoadLiuyan(string expertid)
{
int recordCount = 0;
string condtions = " and expertid='" + expertid + "'";
DataTable dt = BLL.AgentArticle.GetLiuYan(condtions, 1, 5, out recordCount);
PageTurn1.RecordCount = recordCount;
CommonMethod.BindRepeater(rpLeaveWord, dt);
//this.lblCount.Text =dt.Rows.Count.ToString();
}
这里有一个分页调用
.aspx
<asp:Repeater ID="rpLeaveWord" runat=server>
<ItemTemplate>
<div class="pm-SX2">
<div class="pm-SX3">
<div style="height:24PX"><span style="font-weight:bold"><%# PageTurn1.RecordCount - Container.ItemIndex%>楼:<%#Eval("name") %> </span><span class="right" style=" margin-top:-24px; color:#B7B7B7"><%#DataBinder.Eval(Container.DataItem,"LASTMODIFICATIONTIME") %></span></div>
<div style="text-indent:2.5EM;"><%#CommonMethod.RemoveHTMLTrim(Eval("content")) %></div>
</div>
<div class="pm-SX3" style=" background-color:#FFFFFF;">
<div style="height:24PX; padding-top:4px"><span style="font-weight:bold"><span style="color:#FF6600">专家</span>回复6楼</span><span class="right" style=" margin-top:-24px; color:#B7B7B7"><%#DataBinder.Eval(Container.DataItem,"LASTMODIFICATIONTIME") %></span></div>
<div style="text-indent:2.5em"><%#CommonMethod.RemoveHTMLTrim(Eval("r_content"))%></div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
红色标记部分就是倒序的排行

浙公网安备 33010602011771号