I am using MvcPAger in MVC application.

MvcPager Refrence added in my application

MY VIEW

@model  Webdiyer.WebControls.Mvc.PagedList<MvcApplicationdyncat.Models.ProductModel>
<div class="page-list">
   @Html.Pager(Model, new Webdiyer.WebControls.Mvc.PagerOptions { PageIndexParameterName = "page", FirstPageText = "First", ShowPrevNext = true, ShowFirstLast = true, PrevPageText = "Prev", NextPageText = "Next", LastPageText = "Last", CurrentPagerItemWrapperFormatString = "<a href='#' class='selected'>{0}</a>" })
</div>

Controller :

using Webdiyer.WebControls.Mvc;
PagedList<ProductModel> pagedList = productModels.ToPagedList<ProductModel>(num, this.ProductListPageSize);
return View(pagedList);

My question is

1>If we are adding mvcpager reference in project and also in view so why we are not found "Pager" extension after @Html. ? 2>Any other reference is required for Pager ?

有帮助吗?

解决方案

Try to add this statement on the first line in your view:

@using Webdiyer.WebControls.Mvc

Do you use the MvcPager code files in your project? Or do you have them as a separate project that you compile into a dll? If you have them in your own project you have to put them in the right folder. You can create a folder named MvcPager and put all of them there. If you put the files in the wrong folder they might not compile and then you can't use them.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top