Add pagination state to Pager in Index.razor
When clicking the Roles or Edit button, returning would load the first page. Pager now tracks and updates the current page using a new _page field and the CurrentPage/OnPageChange parameters. This improves pagination handling and user experience by persisting the current page state.
This commit is contained in:
@@ -33,7 +33,7 @@ else
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<Pager Items="@users" RowClass="align-middle" SearchProperties="User.Username,User.Email,User.DisplayName">
|
||||
<Pager Items="@users" CurrentPage="@_page.ToString()" OnPageChange="@((page) => _page = page)" RowClass="align-middle" SearchProperties="User.Username,User.Email,User.DisplayName">
|
||||
<Header>
|
||||
<th style="width: 1px;"> </th>
|
||||
<th style="width: 1px;"> </th>
|
||||
@@ -551,6 +551,7 @@ else
|
||||
@code {
|
||||
private List<UserRole> users;
|
||||
private string _deleted = "false";
|
||||
private int _page = 1;
|
||||
|
||||
private string _allowregistration;
|
||||
private string _registerurl;
|
||||
|
||||
Reference in New Issue
Block a user