Click here to Skip to main content
15,891,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C#
'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
HTML
@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
How to Work With Grid For both (Searching, Pageing) functionalities in MVC4.
if anyone known please provide answer
Posted
v2

1 solution

You can check out the following link to perform the paging, sorting and searching in the MVC. The application is developed on MVC 5:

Perform Paging, Searching, Sorting in MVC 5

or if you want to perform in the MVC 4 then the refer to the following link:

Paging, Sorting in MVC 4

If you have any problem then ask me..
 
Share this answer
 
v2

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