From 36028cebcc1c430c8f53ce3e9c2c94a985d89084 Mon Sep 17 00:00:00 2001 From: magicjar <9734293+magicjar@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:42:13 +0700 Subject: [PATCH] Ensure Previous Pagination Button is Disabled for Invalid Page --- .../Pagination/AbpPaginationTagHelperService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs index 9d1bac7f5f..115d6eeb02 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/AbpPaginationTagHelperService.cs @@ -106,11 +106,11 @@ public class AbpPaginationTagHelperService : AbpTagHelperService GetPreviousButtonAsync(TagHelperContext context, TagHelperOutput output) { var localizationKey = "PagerPrevious"; - var currentPage = TagHelper.Model.CurrentPage == 1 - ? TagHelper.Model.CurrentPage.ToString() - : (TagHelper.Model.CurrentPage - 1).ToString(); + var currentPage = TagHelper.Model.CurrentPage > 1 + ? (TagHelper.Model.CurrentPage - 1).ToString() + : "1"; return - "
  • \r\n" + + "
  • \r\n" + (await RenderAnchorTagHelperLinkHtmlAsync(context, output, currentPage, localizationKey)) + "
  • "; }