zoukankan      html  css  js  c++  java
  • sqlite mvc分页

      <tr class="tr1">
                    <td>
                        共<asp:Literal runat="server" ID="litNum"></asp:Literal>条内容
                    </td>
                    <td colspan="4">
                        <div style="font-size12pxline-height22pxfont-familyArialpositionrelative;
                            height22px">
                            <zzz:AspNetPager ID="Pager1" runat="server" PageSize="20" ShowInputBox="Always" UrlPaging="true"
                                AlwaysShow="true" LastPageText="末页" NextPageText="下一页" FirstPageText="首页" PrevPageText="上一页">
                            </zzz:AspNetPager>
                        </div>
                    </td>
                    <td align="middle">
                    </td>
                </tr>



    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data;
    using NHibernate;
    using NHibernate.Expression;
    using System.Data;
    using Webdiyer.WebControls.Mvc;


      int recordcount = 0;
            int page = 1;
            page = (string.IsNullOrEmpty(Request.QueryString["page"])) ? 1 : int.Parse(Request.QueryString["page"]);
            //int firstnum = (page == 1) ? 0 : ((page - 1) * Pager1.PageSize);
            string sqlstr = string.Format("SELECT * FROM Vouchers order by Status desc limit {0} offset {0}*{1}", Pager1.PageSize, page - 1);
            DataSet ds = SQLiteHelper.ExecuteQuery(sqlstr);
            DataTable dt = ds.Tables[0];
            recordcount = int.Parse(dt.Rows[0][0].ToString());
            rptPage.DataSource = dt;
           rptPage.DataBind();
           litNum.Text = recordcount.ToString();
           Pager1.RecordCount = recordcount/10;
           Pager1.CurrentPageIndex = page;

    web.congif

    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
           <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" validateRequest="false">
          <controls>
            <add namespace="Wuqi.Webdiyer" assembly="AspNetPager" tagPrefix="zzz"/>
            <add namespace="Business.Project.Website" assembly="TyTextBox" tagPrefix="dry"/>
            <add namespace="PageCtrl" assembly="PageCtrl" tagPrefix="cc1"/>
          </controls>
        </pages>
      </system.web>



  • 相关阅读:
    前端-微信公众号开发(jssdk)
    wampserver 配置本地环境局域网内pc移动访问
    客户端缓存之localStorage and sessionStorage
    webpack+vue搭建基础
    高德地图javascriptAPI基本使用心得(下)
    高德地图javascriptAPI基本使用心得(上)
    表单单选多选项清除默认样式小技巧
    (原创)C#零基础学习笔记003-流程控制语句
    (原创)C#零基础学习笔记002-表达式与运算符
    (原创)C#零基础学习笔记000-学习结构
  • 原文地址:https://www.cnblogs.com/ft-Pavilion/p/4720297.html
Copyright © 2011-2022 走看看