manjula d

manjula d

  • NA
  • 172
  • 140.3k

Grid Sorting, Searching, Pageing in MVC4 ASP.Net With Entity

Feb 19 2014 5:12 AM
 Using Grid for Sorting, Searching, Paging functionality in MVC4 ASP.Net With Entity Framework
my problem is:
  i was done the sorting, searching and paging functionality in mvc4 but when pageing is working not probable for search functionality 
the ERROR is:

The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[Company.Models.EmployeeDetails]', but this dictionary requires a model item of type 'PagedList.IPagedList`1[Company.Models.EmployeeDetails]'.

 
below is pageing functionality in emplist.cshtml
 
@model PagedList.IPagedList<Company.Models.EmployeeDetails>
@using PagedList.Mvc;
 
<table align="center">
<tr>
<td>
page@(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("EmpList", new { page }), PagedListRenderOptions.PageNumbersOnly)
</td>
</tr>
</table>
 if  i comment the aboue pageing functionality Perfectly working Searching functionality 
if anyone known please provide answer