diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs index db74266f38..980aacee8a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs @@ -54,8 +54,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination CurrentPage = currentPage; } - ShowingFrom = totalCount == 0 ? 0 : CurrentPage * PageSize; - ShowingTo = totalCount == 0 ? 0 : ShowingFrom + PageSize; + ShowingFrom = totalCount == 0 ? 0 : (CurrentPage - 1) * PageSize + 1; + ShowingTo = totalCount == 0 ? 0 : (int)Math.Min(ShowingFrom + PageSize - 1 , totalCount); PreviousPage = CurrentPage <= 1 ? 1 : CurrentPage - 1; NextPage = CurrentPage >= TotalPageCount ? CurrentPage : CurrentPage + 1; Pages = CalculatePageNumbers();