Aspnetpager + GridView + ASP. AJAX Page No Refresh implementation

Source: Internet
Author: User

Prepare resources:

Aspnetpager Download URL: http://www.webdiyer.com/download/default.aspx

ASP. NET AJAX Download URL: http://www.asp.net/downloads/

First of all, we should first understand aspnetpager this paging tool work, or there are several paging methods, Aspnetpager officially said: Support through the URL paging, support postback paging, the difference between:/HTTP Detailed instructions are available on the www.webdiyer.com/AspNetPager/WhyUrlPaging.aspx. In fact, url paging is a full address followed by a number of pages to jump, such as http://www. xxx.com/xxx/xxx.aspx?page=2, while postback paging is displayed in the browser status bar such as Javascript:__dopostback (' xxx$xxx$xxx ', ' 2 '), is clearly the way of background calls.

Knowing the paging mechanism, we know that we should choose the kind of facet mechanism to compare with ASP. NET AJAX is simpler, is postback.

Postback way:

<webdiyer:aspnetpager id= "AspNetPager1" runat= "Server" pagesize= "numericbuttoncount=" 10 "
Showcustominfosection= "left" pagingbuttonspacing= "0" alwaysshow= "true" showdisabledbuttons= "false"
cssclass= "Pager_css" horizontalalign= "right" submitbuttontext= "Go" showmorebuttons= "true"
numericbuttontextformatstring= "[{0}]" onpagechanged= "aspnetpager1_pagechanged" currentpagebuttonposition= " Beginning "
firstpagetext= "Home" lastpagetext= "last" nextpagetext= "Next" prevpagetext= "previous"
Showpageindexbox= "Always" textafterpageindexbox= "page" textbeforepageindexbox= "Go" >
</webdiyer:AspNetPager>

Url Rewrite method:

<webdiyer:aspnetpager id= "AspNetPager1" runat= "Server" pagesize= "numericbuttoncount=" 10 "
Showcustominfosection= "left" pagingbuttonspacing= "0" alwaysshow= "true" showdisabledbuttons= "false"
cssclass= "Pager_css" horizontalalign= "right" submitbuttontext= "Go" showmorebuttons= "true"
numericbuttontextformatstring= "[{0}]" onpagechanged= "aspnetpager1_pagechanged" currentpagebuttonposition= " Beginning "
Pagingbuttonlayouttype= "Span" showpageindexbox= "Always" textafterpageindexbox= "page" textbeforepageindexbox= "Go" urlpaging= "True" >
</webdiyer:AspNetPager>

Note An important difference between the two:urlpaging= "True"

The rest is needless to say, such as importing ASP. NET AJAX references, but it is important to note when configuring the Web. config file, especially in projects that have already been built. The best thing to do is to build an ASP. NET AJAX project, and then copy the contents of its web. config into your project configuration file, test your eyesight and endurance, hehe. On the page is to put the GridView and Aspnetpager in the Asp:updatepanel.

These are just the tip of the iceberg of the ASP. NET AJAX feature, which does not provide a way to use, research and use of ASP. NET AJAX will certainly make your Web project more plump.

Aspnetpager + GridView + ASP. AJAX Page No Refresh implementation

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.