Cannot use NuGet PagedList ASP.NET MVC # View

2019-03-12 13:51发布

I can't use the following namespace PagedList to use razor @model PagedList.IPagedList<PhoneBook.Models.Contact>in the topmost of view Index.cshtml

I already installed PagedList and i used already the code below in my Controller

 using PagedList;

there's no error in the controller page but why ican't use the namespace in Index.cshtml (View)? Please help..

7条回答
狗以群分
2楼-- · 2019-03-12 14:18

I believe I had exactly the same problem. Visual Studio underlines PagedList in red and asks "are you missing a using directive or assembly reference?".

All I had to do was build the project. Then Visual Studio stops complaining.

查看更多
登录 后发表回答