1
Good afternoon,
I have several pages where the user can filter through 5 different fields and when the user clicks on the form search button, 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 of this screen, because when I try to change page, also passing through the URL, the search data is lost.
I know that if I put each variable in the Actionlink of the pagination, I will be able to obtain each of the variables, keeping the search and pagination. The problem is that my paging is being mounted in a generic Partial View (below the code) and would like to continue like this, without having to create a separate page for each screen. It is 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.