0

I have two pages.

On first user want to filter some data. After that he pick some value and go to second page.

On second page he will do some tasks and then he want to get back to first page to pick some other value to do other tasks.

But for now he have to filter back some data (on first page), but I want call back his filters. Is there any way to do this?

Adriano
  • 874
  • 2
  • 11
  • 37
  • 1
    You may want to store first page's filters using [Session](https://msdn.microsoft.com/en-us/library/ms178581.aspx) – STT Sep 15 '17 at 08:34
  • Don't you store the selections from the first page somewhere? In a database or something? Otherwise not sure what good selecting anything on the page is. If it's in the db, just pull it out again – Brian White Sep 15 '17 at 09:16

1 Answers1

1

You got a few options here for this.

As STT mentioned in his comment to save the filter data in a session variable/ViewState, works all fine when you only got one web server otherwise you need to setup a shared sessions cache etc. The date will be kept temporary in the Server.

You can also save the data to a cookie and when loading page 1 reload last used filter used from the cookie. Then you got control of the expiry and session data is stored in Web Browser.

By adding the data for the filter into an URI parameter you can from page 2 include the data when user clicks a back button (not the browsers back button) The advantage of this its not session sensitive and the user can bookmark the url to get same filter later on.

StefanE
  • 7,578
  • 10
  • 48
  • 75