I have table with ajax paging, i can select any page and view data, but if i press refresh in my browser, it’s shows page number one. How can i stay on the same table page after refreshing?
Here is a part of code.
@using (Ajax.BeginForm(new AjaxOptions() { UpdateTargetId = "users_rows", Url = Url.Action("UsersRows") }))
{
<table>
<thead>
<tr>
<th>@Resources.Id</th>
<th>@Resources.Login</th>
<th>@Resources.Password</th>
<th>@Resources.FirstName</th>
<th>@Resources.LastName</th>
<th>@Resources.Birthday</th>
<th>@Resources.IsActive</th>
<th>@Resources.Role</th>
<th>@Resources.RegistrationDate</th>
</tr>
</thead>
<tbody id="users_rows">
@Html.Partial("UsersRows", Model)
</tbody>
</table>
}
@Html.Partial("Pager", Model)
Pager.cshtml:
@model UserManagmentStudio.Domain.IPager
@if (Model.PageCount > 1)
{
for (Int32 i = 1; i <= Model.PageCount; i++)
{
@Ajax.ActionLink(i.ToString(), "Index", new {page = i},
new AjaxOptions()
{
UpdateTargetId = "users_rows",
Url = Url.Action("UsersRows", new { page = i }),
}
)
@: 
}
}
There is no way to achieve that because you are using AJAX for your pagination and thus never reloading the current page. If you remove the AJAX call and perform full postbacks for your pagination, the url of the browser will be updated and if the user hits
<kbd>F5</kbd>he will not loose track of the current page because it will be part of the query string.