=====================================================前台
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<webdiyer:AspNetPager ID="InfoPager" runat="server" OnPageChanged="InfoPager_PageChanged"
FirstPageText="[首页]" LastPageText="[尾页]" NextPageText="[下一页]" PrevPageText="[上一页]"
ShowNavigationToolTip="True" NumericButtonCount="5" PageSize="10" CssClass="paginator"
ShowCustomInfoSection="Right" AlwaysShow="true" ShowPageIndexBox="Always" SubmitButtonText="转到"
SubmitButtonClass="button_g_s">
</webdiyer:AspNetPager>
=====================================================后台
public string GetPagerHtml()
{
string html = "";
html += "共:%PageCount%页 ";
html += "共:%RecordCount%条 ";
html += "当前:第%CurrentPageIndex%页 ";
html += "第%StartRecordIndex%-%EndRecordIndex%条";
return html;
}
1,this.InfoPager.CustomInfoHTML = this.GetPagerHtml(); //获取分页要显示的数据
2,GetCondition()条件分页
3,返回DataTable
{
声明一个int类型的变量(out 引用)
实例化公共类的方法(new Facade.Public.PublicQuery().InfoQuery(表名或视图名,当前页,每页显示多少数据,查询字段,条件,排序,1为顺序,out 引用的变量(返回总数据并计算出页数)))
获取out引用
}
3,InfoPager_PageChanged事件
转载于:https://blog.51cto.com/962410314/1382893