Home Sorting, Filtering, and Paging in an ASP.NET MVC Application (Model)
Reply: 0

Sorting, Filtering, and Paging in an ASP.NET MVC Application (Model)

user4959
1#
user4959 Published in September 21, 2018, 8:04 am

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. ????

share|improve this question

2 Answers 2

active oldest votes
up vote 1 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.349993 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO