From 5c0f7fae29201c42af35984648328faf56d73728 Mon Sep 17 00:00:00 2001 From: yigith Date: Sun, 21 Jun 2020 04:35:29 +0300 Subject: [PATCH] preserve filters while paginating (#405) --- src/Web/Pages/Shared/_pagination.cshtml | 69 ++++++++++++++----------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/src/Web/Pages/Shared/_pagination.cshtml b/src/Web/Pages/Shared/_pagination.cshtml index f79448f..df31c23 100644 --- a/src/Web/Pages/Shared/_pagination.cshtml +++ b/src/Web/Pages/Shared/_pagination.cshtml @@ -1,34 +1,43 @@ @model PaginationInfoViewModel - +@{ + var prevRouteData = Context.Request.Query.ToDictionary(x => x.Key, x => x.Value.ToString()); + if (prevRouteData.ContainsKey("pageId")) + prevRouteData.Remove("pageId"); + prevRouteData.Add("pageId", (Model.ActualPage - 1).ToString()); + var nextRouteData = Context.Request.Query.ToDictionary(x => x.Key, x => x.Value.ToString()); + if (nextRouteData.ContainsKey("pageId")) + nextRouteData.Remove("pageId"); + nextRouteData.Add("pageId", (Model.ActualPage + 1).ToString()); +}
-
-
- -
-
+
+
+ +
+