Html.Pager

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 1 an
Html.Pager(Model)  not working in my plugin I get that error:
IHtmlHelper<ExternalCouponModel>' does not contain a definition for 'Pager' and
no accessible extension method 'Pager' accepting a first argument of type 'IHtmlHelper<ExternalCouponModel>' could be found (are you missing a using directive or an assembly reference?)  



@model ExternalCouponModel
@{
    Layout = "_ColumnsTwo";
}


@if (Model.ExternalCoupon.Count > 0)
{
    <div class="product-list">
        <div class="item-grid">
            @foreach (var coupon in Model.ExternalCoupon)
            {
                <div class="item-box">
                    @await Html.PartialAsync("_CouponBox", coupon)
                </div>
            }
        </div>
    </div>

    var pager = Html.Pager(Model)
        .QueryParam("pagenumber")
        .RenderEmptyParameters(true);

    @if (!await pager.IsEmpty())
    {
        <div class="pager">
            @pager
        </div>
    }
}

else if (!string.IsNullOrEmpty(Model.NoResultMessage))
{
    <div class="no-result">
        @Model.NoResultMessage
    </div>
}
Il y a 1 an
Did you add  
@using Nop.Web.Extensions
To your _ViewImports.cshtml file
Il y a 1 an
Thank you 😊
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.