Sorting, Filtering, and Paging in an ASP.NET MVC 5 Application.
My Code:
@model PagedList.IPagedList<PublicRelations.Models.Suggestion>
@using PagedList.Mvc;
...
...
...
<table class="table table-hover table-striped table-responsive">
<tr>
<th>
@Html.ActionLink(model => model.Name, "Index", new { sortOrder = ViewBag.NameSortParm })
</th>
<th>
...
...
...
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
...
...
...
</table>
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("Index", new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))
Error :
@Html.ActionLink(model => model.Name, "Index", new { sortOrder = ViewBag.NameSortParm })
error : Cannot convert lambda expression to type 'string' because it is not a delegate type. ????