How do you implement paging in ASP.NET MVC?

后端 未结 4 1500
天涯浪人
天涯浪人 2021-02-13 14:05

Currently, I\'m using a strategy found on many blog posts. Basically, the URL contains the page number (e.g. /Users/List/5 will give you the users on page 5 of your paged list

4条回答
  •  忘了有多久
    2021-02-13 14:33

    If you use query parameters then the page links in each list have to know about each other in-order to pass both parameters.

    If the two lists are independent of each other then you can update them individually using jquery & ajax. Simply place each list in their own div as a partial view.

    <%= Html.RenderPartial ("ListA") %>
    <%= Html.RenderPartial ("ListB") %>

    Lookup ajaxSubmit from the jQuery Form plugin for an easy way to update the lists.

提交回复
热议问题