Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have list of entities in model , i want to render it as grid allow paging , cause when i render all entities the page render slowly

here is current code
HTML
<div class="col_full nobottommargin" id="divUnlinkedUserClients">
<input type='checkbox' onclick="return checkAll(this);">
                                    Select All checkbox
 @{
    for (int i = 0; i < Model.UnlinkedUserClients.Count; i++)
    {
     <div>

      @Html.CheckBoxFor(m => Model.UnlinkedUserClients[i].IsSelected)

      @Model.UnlinkedUserClients[i].FullNameLastFirst

      @if (Model.UnlinkedUserClients[i].UserClientStatusId ==        RspPublic.Models.Enumerations.UserClientStatus.PendingLinkToAccount)
       {
        <text> (Pending Access)</text>
       }

     </div>
    }
 }
</div>
Posted

1 solution

There are many pageable javascript/jquery based grids out there. Some of them have also MVC helpers you can use. Still, if pagination is the only requirement, it is quite simple to implement with jquery and an ajax backend in the controller.
This is one approach: Custom Pagination with ASP.NET MVC[^]
Take a look also on these:
http://www.codeguru.com/csharp/article.php/c18513/Add-Simple-Ajax-Paging-to-Grids-in-ASPNET-MVC.htm[^]
http://www.techiesweb.net/paging-sorting-filtering-to-your-asp-net-mvc-projects-with-ktable-plugin/[^]
http://www.lybecker.com/blog/2014/09/29/ajax-paging-for-asp-net-mvc-sites/[^]
http://www.joe-stevens.com/2011/05/30/asp-net-mvc-simple-server-side-ajax-paging-using-jquery/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900