Smetko.Paging.Mvc
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Smetko.Paging.Mvc --version 1.0.0
NuGet\Install-Package Smetko.Paging.Mvc -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Smetko.Paging.Mvc" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Smetko.Paging.Mvc --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Smetko.Paging.Mvc, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Smetko.Paging.Mvc as a Cake Addin #addin nuget:?package=Smetko.Paging.Mvc&version=1.0.0 // Install Smetko.Paging.Mvc as a Cake Tool #tool nuget:?package=Smetko.Paging.Mvc&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Smetko.Paging
C# library for paginating results in (or out of) ASP.NET CORE MVC 6
Without extension methods.
Usage
var query = context.Product.Where(criteria);
// no mapping
var pagedList = PagedList<Product>.FromQueryable(query);
var pagedList = PagedList<Product>.FromQueryable(query, pageNumber: 1);
var pagedList = PagedList<Product>.FromQueryable(query, pageNumber: 1, pageSize: 50);
// with mapping
Func<Product, ProductDto> mapper = x => new ProductDto() {Name = x.Name, Price = x.Price};
var pagedList = PagedList<ProductDto>.FromQueryable(query, mapper);
var pagedList = PagedList<ProductDto>.FromQueryable(query, mapper, pageNumber: 1);
var pagedList = PagedList<ProductDto>.FromQueryable(query, mapper, pageNumber: 1, pageSize: 50);
Smetko.Paging.Mvc
Razor tools for rendering paginated results. Requires Smetko.Paging
Usage
Tell MVC how to find paging templates in your Startup.cs
services.Configure<RazorViewEngineOptions>(options =>
{
options.FileProviders.Add(
new EmbeddedFileProvider(typeof(Smetko.Paging.UrlHelperExtensions).Assembly));
});
Show pager first, prev,1,2,3,4...,next,last)
@model Smetko.Paging.PagedList<Product>
@{ Html.RenderPartial("_PagerPartial", Model.Pager); }
Extra
To use your own pager template create Views/Shared/_PagerPartial.cshtml:
@using Smetko.Paging
@model Smetko.Paging.Pager
@if (Model.EndPage > 1)
{
<ul class="pagination">
@if (Model.CurrentPage > 1)
{
<li>
<a href="@Url.Current(new { pageNumber = 1 })">First</a>
</li>
<li>
<a href="@Url.Current(new { pageNumber = Model.CurrentPage - 1 })">Previous</a>
</li>
}
@for (int page = Model.StartPage; page <= Model.EndPage; page++)
{
<li class="@(page == Model.CurrentPage ? "active" : "")">
<a href="@Url.Current(new { pageNumber = page })">@(page)</a>
</li>
}
@if (Model.CurrentPage < Model.TotalPages)
{
<li>
<a href="@Url.Current(new { pageNumber = Model.CurrentPage + 1 })">Next</a>
</li>
<li>
<a href="@Url.Current(new { pageNumber = Model.TotalPages })">Last</a>
</li>
}
</ul>
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.0
- Microsoft.AspNetCore.Mvc (>= 2.0.1)
- Smetko.Paging (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.