This example for you to share the Ajax no refresh pagination of the specific code for your reference, the specific contents are as follows
HTML page
webservice1.asmx
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.Services;
Using System.Data; Namespace Page {///<summary>///WebService1 Summary description///</summary> [WebService (Namespace = "Http://temp uri.org/")] [webservicebinding (ConformsTo = wsiprofiles.basicprofile1_1)] [System.ComponentModel.ToolboxItem (False
)]//To allow the use of ASP.net AJAX to invoke this Web service from a script, uncomment the downlink. [System.Web.Script.Services.ScriptService] public class WebService1:System.Web.Services.WebService {[Webmetho
D] public string HelloWorld () {return ' Hello world '; [WebMethod] public list<model.t_news1> getlistajax (int pagesize,int pageindex) {BLL. T_news1 bnews = new BLL.
T_NEWS1 (); DataTable dt = bnews.
Getlistdatatable (Pagesize,pageindex);
list<model.t_news1> list = new list<model.t_news1> ();
int Id;
String newstitle = "";
String newscontent = ""; DateTime CreaTetime; for (int i = 0; i < dt. Rows.Count; i++) {Id = Convert.ToInt32 (dt.
rows[i]["Id"]); Newstitle = dt. rows[i]["Newstitle"].
ToString (); newscontent = dt. rows[i]["Newscontent"].
ToString (); Createtime = convert.todatetime (dt.
rows[i]["Createtime"]); MODEL.T_NEWS1 news = new Model.t_news1 () {id = id, newstitle = newstitle, Newscon
Tent = newscontent, createtime = Createtime}; List.
ADD (news);
} return list; [WebMethod] public int getlastpageindex (int pagesize) {BLL. T_news1 bnews = new BLL.
T_NEWS1 (); int totalcount = Bnews.
GetRecordCount ("");
if (totalcount% pagesize = = 0) {return totalcount/pagesize;
else {return totalcount/pagesize + 1;
}
}
}
}
Above is the Ajax no refresh paging implementation of the key code, I hope to help you learn.