2
What are the best ways to stay with a selected item in a select after page transition (Go to a page and then return with the already selected fields) using ASP.NET MVC? Session? Cache? Tempdata? Hidden field?
2
What are the best ways to stay with a selected item in a select after page transition (Go to a page and then return with the already selected fields) using ASP.NET MVC? Session? Cache? Tempdata? Hidden field?
2
GET
That’s why the parameterization GET
was made: so that, in a page change, the filters remain.
I’m guessing you have one <form>
at some View your:
@using (Html.BeginForm()) { ... }
By default, forms in ASP.NET MVC are POST
, but nothing stops us from using like this:
@using (Html.BeginForm("Pesquisa", "MeuController", FormMethod.Get)) { ... }
When submitting your form, you will notice that the completed parameters will all go to the address bar. If you place the form inside the search result screen, you will see that the filters are filled.
In my case, it’s not a form, it’s a few dropdowns, as it would look?
Please edit your question and ask how are the Dropdowns.
Browser other questions tagged html asp.net-mvc http
You are not signed in. Login or sign up in order to post.
Depends... has how to explain more your scenario?
– PauloHDSousa
I put a filter on a page, access the detail of an item that is already filtered in a table (On another page). I have the option to return to the previous page, but I would like it to remain with the filters I had already done.
– Amon
You can create a Single page application or save all this somewhere, I think in the cache of the quiet
– PauloHDSousa