这是完整的错误
Error CS1929 'IHtmlHelper>' does not contain a definition for 'PagedListPager' and the best extension method overload 'HtmlHelper.PagedListPager(HtmlHelper, IPagedList, Func)' requires a receiver of type 'HtmlHelper' BookSystem E:\source\TelerikAlpha\BookSystem\BookSystem\Views\Manage\Index.cshtml 52 Active
我所遵循的只是微软分页教程中的代码:https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application 有人知道为什么会这样吗?
最佳答案
我也有这个问题。有许多与 PagedList 相关的 NuGet 包,所以找到合适的是个问题。
对于 MVC 应用程序,我需要的 NuGet 包是 X.PagedList.Mvc.Core。
在 Visual Studio 中,转到工具 --> NuGet 包管理器 --> 管理解决方案的 NuGet 包。浏览 X.PagedList.Mvc.Core 并为您的项目安装它。
在您实现分页的 View 中,添加:
@using X.PagedList.Mvc.Core
关于model-view-controller - ErroCS1929 'IHtmlHelper<IPagedList<Book>>' 不包含 'PagedListPager' 的定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54564713/