Step 2: Include the following using statements in HomeController.cs fileusing PagedList.Mvc;using PagedList;

Modify the Index() action method as shown below. Notice that we are passing page parameter to this function. This parameter is used for specifying the page number. This parameter can be null, and that's the reason we have chosen a nullable integer. We convert the list, to a paged list, using ToPagedList(). Also, notice that, we are using null-coalescing operator. If the "page" parameter is null, then 1 is passed as the page number, else, the value contained in the "page" parameter is used as the page number.publicActionResult Index(string searchBy, string search, int? page){if (searchBy == "Gender") {return View(db.Employees.Where(x => x.Gender == search || search == null).ToList().ToPagedList(page ?? 1, 3)); }else {return View(db.Employees.Where(x => x.Name.StartsWith(search) || search == null).ToList().ToPagedList(page ?? 1, 3)); }}

Step 3: Make the following modifications to Index.cshtml viewa) Include the following 2 using statements on the view.@using PagedList.Mvc;@using PagedList;

b) The model for the view should be IPagedList<Employee>.@modelIPagedList<MVCDemo.Models.Employee>

c) Since, we have changed the model of the view, from IEnumerable<MVCDemo.Models.Employee> to IPagedList<MVCDemo.Models.Employee>, change the section that displays table headings as shown below.<tr><th>@Html.DisplayNameFor(model => model.First().Name)</th><th>@Html.DisplayNameFor(model => model.First().Gender)</th><th>@Html.DisplayNameFor(model => model.First().Email)</th><th>Action</th></tr>

I have a question about paging. When I implements paging at the bottom of the web page I see the item in a vertical bullet list. How can I fix that problem. I work with Entity Framework 5 and download the latest paging program from nuget solutions. Do I have a version conflict?

Hi I have a big question you should read carefully it is very important about this page list if we have hundred records so fine if there thousands or millions records and we use this paged list library and take 100 records by one page so it will hit the db and make the pagination divided by 100 records so when we click to next paging it will again hit the db and then collect the all records data and again it will perform his operation to make pagination it is very worst performance because it will hit every time when click for next paging. I hope you got my point and it is too important so kindly suggest me other solution because it is not useful for big records data