SQLite MVC pagination

Source: Internet
Author: User

<TrClass="TR1"><Td> Total<Asp:LiteralRunat="Server"Id="Litnum"></Asp:Literal> article content</Td><Tdcolspan="4"><DivStyle="Font-size:12px;Line-height:22px;Font-family:Arial;Position:Relative;Height:22px"><zzz:AspnetpagerId="Pager1"Runat="Server"PageSize="20"Showinputbox="Always"Urlpaging="True"Alwaysshow="True"Lastpagetext=LastNextPageText="Next Page"Firstpagetext=HomePrevpagetext="Prev"></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;


<System.Web><Compilation Debug="TrueTargetFramework="4.0 "/><PagescontrolRenderingCompatibilityVersion="3.5 "ClientIDMode="Autoid "ValidateRequest="False><Controls><AddNamespace="Wuqi.webdiyer "Assembly="Aspnetpager "TagPrefix="zzz/><AddNamespace="Business.Project.Website "Assembly="Tytextbox "TagPrefix="Dry/><add namespace= "pagectrl"  assembly< Span style= "color:blue;" >= "pagectrl"  tagPrefix< Span style= "color:blue;" >= "cc1" />       </controls>    </pages>  </system.web>     

SQLite MVC pagination

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.