No refreshing Ajax pages

Source: Internet
Author: User
<! 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

 

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.