Created
June 9, 2020 20:34
-
-
Save mzorec/4454a1f42f2ccb5b6fe97a5e4bcb4509 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="pagination"> | |
@for(var i = 1; i <= totalPages; i++) | |
{ | |
<li class="page-item @(i == pageNumber ? "active" : "")"> | |
<a href="@linkUrl/@i" class="page-link">@i</a> | |
</li> | |
} | |
</ul> | |
@code { | |
[Parameter] int pageNumber { get; set; } | |
[Parameter] int totalRecords { get; set; } | |
[Parameter] int pageSize { get; set; } = 20; | |
[Parameter] string linkUrl { get; set; } | |
int totalPages => (int)Math.Ceiling((decimal)totalRecords / pageSize); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment