分页控件

前台使用jquery.pagination.js

后台使用AspNetPager




<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

添加AspNetPager.dll引用


   <div class="list-page">
                            <div runat="server" id="divsj">
                            </div>
                            <asp:Label ID="recordstatus" runat="server" Text="没有记录" Visible="false"></asp:Label>
                            <table align='center' width="100%" style="padding-top: 15px;">
                                <tr>
                                    <td class="page" align="center">
                                        <webdiyer:AspNetPager ID="AspNetPager1" AlwaysShow="True" runat="server" PagingButtonSpacing="10px"
                                            showcustominfo="True" ShowCustomInfoSection="Never" Width="100%" NumericButtonCount="5"
                                            OnPageChanging="pageBind_PageChanging" CenterCurrentPageButton="True" FirstPageText="首 页"
                                            LastPageText="尾 页" NextPageText="下 页" NumericButtonType="Image" PrevPageText="上 页"
                                            ShowNavigationToolTip="True" ShowPageIndexBox="Never" CustomInfoHTML="" CustomInfoSectionWidth="30%"
                                            CustomInfoTextAlign="Left">
                                        </webdiyer:AspNetPager>
                                    </td>
                                </tr>
                            </table>
                        </div>


     DataTable dt = //查数据


            this.rpt1.DataSource = dt;
            this.rpt1.DataBind();


            if (dt.Rows.Count == 0)
            {
                recordstatus.Visible = true;
                AspNetPager1.Visible = false;
            }
            else
            {
                AspNetPager1.Visible = true;
                recordstatus.Visible = false;
            }


            pagecount = Convert.ToInt32(Math.Floor((float)recordcount / PAGE_SIZE));    //总页码     
            if (recordcount % PAGE_SIZE != 0) pagecount += 1;
            if (pagecount <= 0) pagecount = 1;
            int minRowIndex = currentpage - 1;
            if (minRowIndex < 1) minRowIndex = 0;


            AspNetPager1.PageSize = PAGE_SIZE;
            AspNetPager1.RecordCount = recordcount;
            AspNetPager1.CurrentPageIndex = currentpage;


            AspNetPager1.CustomInfoHTML = "&nbsp;总:<font   color=\"blue\"><b>" + AspNetPager1.RecordCount.ToString() + "</b></font>条&nbsp;";
            AspNetPager1.CustomInfoHTML += "&nbsp;<font   color=\"red\"><b>" + AspNetPager1.PageSize.ToString() + "</b></font>/页";
            AspNetPager1.CustomInfoHTML += "&nbsp;&nbsp;总页数:<font   color=\"blue\"><b>" + AspNetPager1.PageCount.ToString() + "</b></font>";
            AspNetPager1.CustomInfoHTML += "&nbsp;第<font   color=\"red\"><b>" + AspNetPager1.CurrentPageIndex.ToString() + "</b></font>页";


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值