<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;
Web.congif
<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