pagination working

(TODO: check for remaining pages)
This commit is contained in:
Dimitar Byalkov
2023-03-30 00:42:34 +02:00
parent 5c0eb222a4
commit 78eba13712
4 changed files with 40 additions and 17 deletions

View File

@@ -11,7 +11,11 @@ namespace WebApp.Pages
public void OnGet(int? p, int? c)
{
UserManager = new UserManager();
ViewData.Add("users", UserManager.GetUsersByPage(p, c));
if (p == null || p < 1)
{
p = 1;
}
ViewData.Add("users", UserManager.GetUsersByPage(p - 1, c));
ViewData.Add("page", p);
ViewData.Add("allCount", UserManager.GetAllUsers().Count());
}