Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use NuGet PagedList ASP.NET MVC # View

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..

like image 947
Jed Avatar asked May 18 '12 13:05

Jed


1 Answers

BuildStarted referral or existing on at the same time use,

in controller

using PagedList;
using PagedList.Mvc;

and use in view

@model PagedList.IPagedList<PhoneBook.Models.Contact>
@using PagedList;
@using PagedList.Mvc;

and use paging

@Html.PagedListPager(Model, page => Url.Action("Index", new { page =
page }))
like image 53
B. Bilgin Avatar answered Sep 30 '22 20:09

B. Bilgin