Good afternoon,
I have several pages where the user can filter through 5 different fields and when the user clicks on the search button of the form, which is configured with the GET method, the search is passed in the URL as QueryString, a variable for each field.
The problem occurs when I need to create the page for this screen, because when I try to change pages, also going through the URL, the search data is lost.
I know that if I put each variable in the ActionLink's paging, I'll be able to get each of the variables, maintaining the search and paging. The problem is that my pagination is being mounted in a generic Partial View (below the code) and I would like to continue this, without having to create a separate page for each screen. Is it possible?
<div>
Página @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
de @Model.PageCount
@if (Model.HasPreviousPage)
{
@Html.ActionLink("<< Primeira", "Details", null, new { pagina = 1 }, null)
@Html.Raw(" ");
@Html.ActionLink("< Anterior", "Details", null, new { pagina = Model.PageNumber - 1 }, null)
}
else
{
@: [ Você está na primeira página ]
}
@if (Model.HasNextPage)
{
@Html.ActionLink("Próxima >", "Details", null, new { pagina = Model.PageNumber + 1 }, null)
@Html.Raw(" ");
@Html.ActionLink("Última >>", "Details", null, new { pagina = Model.PageCount }, null)
}
else
{
@: [ Você está na última página ]
}
</div>
Thank you.