Aspnetpager + gridview + ASP. NET Ajax Implementation of refreshing pagination

Source: Internet
Author: User

See this article on the InternetArticleAspnetpager + gridview + ASP. Net Ajax page refreshing implementation feel a lot of GAINS. We recommend it to you here,

Public partial class hyzxlist: system. Web. UI. Page {protected void page_load (Object sender, eventargs e) {If (! Ispostback) {getdata () ;}} private void getdata () {info I = new info (); int classid = 1; if (! String. isnullorempty (request. querystring ["classid"]) {classid = int. parse (request. querystring ["classid"]. tostring ();} int pageindex = 1; // If (request ["page"]! = NULL) // {// pageindex = convert. toint32 (request ["page"]); //} If (Response <1) {pageindex = 1;} else {pageindex = aspnetpager1.currentpageindex;} int pagenum = aspnetpager1.pagesize; int recordcount; string classname; listview1.datasource = I. getinfobyclassid (pageindex, pagenum, out recordcount, classid, out classname); listview1.databind (); titleleft. innertext = classname; titleright. innerhtml = "your current location>" + classname; aspnetpager1.recordcount = recordcount;} protected void aspnetpager1_pagechanging (Object SRC, Wuqi. webdiyer. pagechangingeventargs e) {aspnetpager1.currentpageindex = E. newpageindex; getdata ();} protected void aspnetpager?pagechanged (Object sender, eventargs e ){}}

The page_changing event is used here;

The pagechanged events that were used at the beginning always prompt strange errors, or simply fail to flip pages;

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.