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..
I just found this question because I was having the same problem. I have read through many tutorials suggesting the use of this PagedList object, but none of them said anything about adding anything to the web.config file. This is what I did in order to make this work. I used some of the info from the comment from @BuildStarted. I am using VS2010.
Add this to the web.config file:
So it should look like this (snipped):
I had the same issue, when I'm using @model
I get error :
Solution :
In View -> Index.cshtml
Replace model.Code with model.First().Code
Restarting Visual Studio fixed it for me.
you need to add reference in your bin/assembly folder.
Try using a non-capitalised "Mvc" in your imports and then rebuild.
BuildStarted referral or existing on at the same time use,
in controller
and use in view
and use paging
Sorry for bad English is.