为什么找不到错误的方法:' Int32 PagedList.IPagedList.get_PageIndex()发生

时间:2015-11-28 16:06:27

标签: asp.net-mvc-3 pagedlist

我正在Mvc 3中进行Paging,但是当我尝试运行该页面时,它给了我错误

找不到方法:' Int32 PagedList.IPagedList.get_PageIndex()

这是我的代码:

<div class="wrapper">
    <!--Rest of the div-->
</div>
<div id="besch"><!--Removed this div from the wrapper div, now it is outside-->
    <p>
      Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy  eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam   voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
    </p>
</div>

以下是查看

public class EmployeeController : Controller
{
    private myContext db = new myContext();

    public ViewResult Index(int? page)
    {
        int pageSize = 20;
        int pageNumber = (page ?? 1);
        return View(db.Employee.OrderByDescending(t=> t.EmployeeID).ToPagedList(pageNumber,pageSize));
    }
}

一切看起来都很好,但我仍然会收到错误。

Erorr Message

0 个答案:

没有答案