title: HtmlHelper does not contain a definition for PagedListPager
body: <p>I'm new to ASP.NET MVC, so this issue might not be too complex. I'm having problems when adding pagination to an ASP.NET MVC project. I've installed pagedlist.mvc from the NuGet package installer and then wrote this simple index code in the controller to pass a paged list:</p>
  <pre><code>using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.Mvc;
  using Microsoft.EntityFrameworkCore;
  using MvcMovie.Data;
  using MvcMovie.Models;
  using PagedList;
  
  namespace MvcMovie.Controllers
  {
      public class MoviesController : Controller
      {
          private readonly MvcMovieContext _context;
  
          public MoviesController(MvcMovieContext context)
          {
              _context = context;
          }
  
          // GET: Movies
          public IActionResult Index(int ? page)
          {
              var movies = from m in _context.Movies select m;
              int pageSize = 3;
              int pageNumber = (page ?? 1);
              return View(movies.ToPagedList(pageNumber,pageSize));
          }
  </code></pre>
  <p>Then, I changed the index view and added <code>@using PagedList.Mvc</code> at the top. I've also changed the model to <code>@model PagedList.IPagedList&lt;MvcMovie.Models.Movie&gt;</code>. The view file looks like this:</p>
  <pre><code>@using PagedList.Mvc;
  @model PagedList.IPagedList&lt;MvcMovie.Models.Movie&gt;
  
  @{
      ViewBag.Title = &quot;Movie List&quot;;
  }
  
  &lt;h1&gt;Listă de filme&lt;/h1&gt;
  
  &lt;p&gt;
      &lt;a asp-action=&quot;Create&quot;&gt;Adaugă film&lt;/a&gt;
  &lt;/p&gt;
  &lt;table class=&quot;table&quot;&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;
                  @Html.DisplayNameFor(model =&gt; model.FirstOrDefault().Title)
              &lt;/th&gt;
              &lt;th&gt;
                  @Html.DisplayNameFor(model =&gt; model.FirstOrDefault().ReleaseDate)
              &lt;/th&gt;
              &lt;th&gt;
                  @Html.DisplayNameFor(model =&gt; model.FirstOrDefault().Genre)
              &lt;/th&gt;
              &lt;th&gt;
                  @Html.DisplayNameFor(model =&gt; model.FirstOrDefault().Price)
              &lt;/th&gt;
              &lt;th&gt;&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          @foreach (var item in Model)
          {
              &lt;tr&gt;
                  &lt;td&gt;
                      @Html.DisplayFor(modelItem =&gt; item.Title)
                  &lt;/td&gt;
                  &lt;td&gt;
                      @Html.DisplayFor(modelItem =&gt; item.ReleaseDate)
                  &lt;/td&gt;
                  &lt;td&gt;
                      @Html.DisplayFor(modelItem =&gt; item.Genre)
                  &lt;/td&gt;
                  &lt;td&gt;
                      @Html.DisplayFor(modelItem =&gt; item.Price)
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;a asp-action=&quot;Edit&quot; asp-route-id=&quot;@item.MovieId&quot;&gt;Editează&lt;/a&gt; |
                      &lt;a asp-action=&quot;Details&quot; asp-route-id=&quot;@item.MovieId&quot;&gt;Detalii&lt;/a&gt; |
                      &lt;a asp-action=&quot;Delete&quot; asp-route-id=&quot;@item.MovieId&quot;&gt;Șterge film&lt;/a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          }
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;br /&gt;
  &lt;div style=&quot;margin:5px;&quot;&gt;
      Page @(Model.PageCount &lt; Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
      @Html.PagedListPager(Model, page =&gt; Url.Action(&quot;Index&quot;,
      new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))
  &lt;/div&gt;
  </code></pre>
  <p>As you can see I've wrote the code at the bottom of the view for displaying pagination, but I get the error:</p>
  <blockquote>
  <p>'IHtmlHelper&lt;IPagedList&gt;' does not contain a definition for
  'PagedListPager' and the best extension method overload
  'HtmlHelper.PagedListPager(HtmlHelper, IPagedList, Func&lt;int, string&gt;)'
  requires a receiver of type 'HtmlHelper'  MvcMovie</p>
  </blockquote>
  <p>I've also tried adding <code>@using PagedList</code> at the top of the view file, but it did nothing.</p>