mardi 20 août 2019

ReflectionIt pagination generates empty hrefs

Asp.Net Core 2.2 using ReflectionIT.Mvc.Paging 3.5.0. Generated View has empty pagination hrefs. How to solve this?

Controller:

public async Task<IActionResult> Index(int page = 1, string sortExpression = "-LastUpdated")
{
  var qry = _context.Invoice.AsNoTracking();
  var model = await PagingList.CreateAsync(qry, 10, page, sortExpression, "-LastUpdated");
  return View(model);
}

View:

@model ReflectionIT.Mvc.Paging.PagingList<Admin.Models.Person>
@using ReflectionIT.Mvc.Paging
@addTagHelper *, ReflectionIT.Mvc.Paging

<nav aria-label="Person navigation">
  @await this.Component.InvokeAsync("Pager", new { pagingList = this.Model })
</nav>

<table class="table table-striped">
 <thead>
    <tr>
        <th>
            @Html.SortableHeaderFor(model => model.Name)
        </th>
        ...
        <th>
            @Html.SortableHeaderFor(model => model.LastUpdated)
        </th>
 </thead>
 ...
</table>

Generated pagination:

<nav aria-label="Person navigation">
  <ul class="pagination">
     <li class="active">
         <a href="">1</a>
     </li>
     <li>
         <a href="">2</a>
     </li>
     ...
  </ul>
</nav>

Generated code uses glyphicon, which is not supported in Bootstrap 4. Perhaps a wrong version the package? Thanks for any help!





Aucun commentaire:

Enregistrer un commentaire