<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
Using system; using system. collections. generic; using system. LINQ; using system. web; Using ajax paging. dal. datasetcommenttableadapters; using system. web. script. serialization; namespace Ajax flip pages {// <summary> /// Summary of pagedservice /// </Summary> public class pagedservice: ihttphandler {public void processrequest (httpcontext context) {context. response. contenttype = "text/plain"; string action = context. reque St ["action"]; If (Action = "getpagecount") {var adapter = new t_commentstableadapter (); int COUNT = adapter. selectcount (). value; int pagecount = count/10; If (count % 10! = 0) {pagecount ++;} context. response. write (pagecount);} else if (Action = "getpagedata") {string getpagedata = context. request ["pagenum"]; // obtain the number of transferred pages. Int ipagenum = convert. toint32 (getpagedata); var adapter = new t_commentstableadapter (); // obtain the adapter var DATA = adapter. getpageddata (ipagenum-1) * 10 + 1, (ipagenum) * 10); // obtain the data list based on the number of pages <comment> List = new list <comment> (); // create list foreach (VAR item in data) // cyclically input the comment attribute postdate, MSG {list in list. add (New Comment () {postdate = item. postdate. tow.datestring (), MSG = item. MSG});} javascriptserializer JSS = new javascriptserializer (); // The serialized list is a JSON context. response. write (JSS. serialize (list) ;}} public bool isreusable {get {return false ;}} public class comment {Public String postdate {Get; set;} Public String MSG {Get; set ;}}}
Select * from (
Select ID, postdate, MSG, row_number () over (order by postdate) rownum from DBO. t_comments
) T
Where T. rownum> [email protected] and T. rownum <@ endrowindex