我无法使用以下命名空间 PagedList
使用 Razor
@model PagedList.IPagedList<PhoneBook.Models.Contact>
在 View 的最上方 Index.cshtml
我已经安装了 PagedList 并且我已经在我的 Controller 中使用了下面的代码
using PagedList;
Controller 页面没有错误,但为什么我不能使用Index.cshtml( View )中的命名空间?请帮忙..
最佳答案
BuildStarted 引用或现有的同时使用,
在 Controller 中
using PagedList;
using PagedList.Mvc;
并在 View 中使用
@model PagedList.IPagedList<PhoneBook.Models.Contact>
@using PagedList;
@using PagedList.Mvc;
并使用分页
@Html.PagedListPager(Model, page => Url.Action("Index", new { page =
page }))
关于asp.net-mvc-3 - 无法使用 NuGet PagedList ASP.NET MVC# View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10653759/