Home  >  Article  >  Backend Development  >  Detailed explanation of the code example of ASP.NET using ajax to implement the function of partially refreshing the page in paging

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

黄舟
黄舟Original
2017-03-23 11:25:581735browse

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?)


       
            
  • .....
  • 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 partially When updating the page, I first thought of the jquery plug-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字
  • 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!

    Statement:
    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