Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have installed PageList.Mvc in NuGet.

How do you add it to the first line of Index.cshtml?
HTML
@model IEnumerable<PagingExample.Models.Table1>

HomeController.cs
C#
using PagedList;
    public class HomeController : Controller
    {
        private testContext db = new testContext();
        public List<Table1> thistable = new List<Table1>();
        public ActionResult Index(int? page)
        {
            thistable = db.Data1.ToList();
            int pageSize = 3;
            int pageNumber = (page ?? 1);
            return View(thistable.ToPagedList(pageNumber, pageSize));
        }
    }
Posted
Comments
Afzaal Ahmad Zeeshan 7-Feb-15 9:59am    
What actually is the problem here? Can you please tell the problem that you're encountering.

1 solution

I'm not sure what the question is, but the documentation is very clear on the usage. It covers the different use cases and might answer your question. https://github.com/TroyGoode/PagedList#how-do-i-use-it[^].
 
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