Detailed explanation of the code example of ASP.NET using ajax to implement the function of partially refreshing the page in paging

黄舟
Release: 2017-03-23 11:25:58
Original
1764 people have browsed it

It is also very simple to use the ajax method to implement paging, mainly two, ContentTemplate and Trigger. First throw the listView into the ContentTemplate. Then add asp:AsyncPostBackTrigger to the Trigger and point the ID to the previous paging control DataPager control. For the specific implementation code, you can refer to this article

It is very easy to implement paging in listview. ListView paging is very simple, just add a DataPager control and assign the ID of the ListView. That's how I wrote it in the beginning. (Some people on the Internet say that this is pseudo-pagination?)

  
  • .....
  • Copy after login

    However, after writing this, the effect of clicking pagination is to refresh the entire page. After refreshing, the page will jump around, which is of course unfriendly, so it needs to be partiallyWhen updating thepage, I first thought of thejqueryplug-in, so I downloaded the JPAGES plug-in from the Internet. After playing with it for a long time, I still couldn't get it, and I didn't know where the error was. . . So I gave up the trap and decided to use ajax! .

    It’s very simple to use the ajax method. There are three steps to install the elephant in the refrigerator.

    1. Introduce the ajax control scriptManager and place it in the form.

    2. Introduce ajax control UpdatePanel.

    3. Edit UpdatePanel content.

    There are mainly two, ContentTemplate and Trigger. First throw the listView into the ContentTemplate. Then add asp:AsyncPostBackTrigger to the Trigger and point the ID to the previous paging control DataPager control, and that's it. The code is as follows:

      <%--数据源--%>    
  • 此处略去1000字
  • Copy after login

    The above is the detailed content of Detailed explanation of the code example of ASP.NET using ajax to implement the function of partially refreshing the page in paging. For more information, please follow other related articles on the PHP Chinese website!

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!