0

I have an asp.net application with a search page, with criteria and result display on the same page. I want to keep a copy of the populated search page to redistribute it later to the same user, upon the button click on another page. It's kind of a "return to search" button. How can I do that?

Here is some context:

The search criteria is made up of some basic controls, and the results are then (after postback) displayed in a GridView. I also have a master page. Simple as that.

Now consider the following scenario: The user can investigate the results by clicking links that show detail pages, and can drill down over quite many detail pages with associated data. If he/she wants to get back to the search results he/she needs to click the back button of the browser quite many times.

I would like to provide a "Back to search" button on the master page that allows to return to the populated search page with one click. Note:

  • I can not use the browser history in any way because it must work also when the user opened one of the detail views in another tab.
  • I have seen Keeping the Viewstate persistent and retrieve it on demand but it hope there is an easier solution because my grid is paginated and I have also more than one search page, where I would like to return to just the last one used.

Thanks, Marcel

Community
  • 1
  • 1
Marcel
  • 15,039
  • 20
  • 92
  • 150
  • I have read a bit into it, but I think this is not really working for me. In the end I do not want to cache requests to a given page, I want to redistribute another page upon a button click. – Marcel Aug 15 '12 at 07:44

1 Answers1

0

I can offer some logical ways to resolve this problem, without using specialized asp.net features if they exist: 1) Is there some way to save the search string in GET request? So you can save it some way between moving through pages? 2) Another way is caching search pattern (with all filters or what you need there) somewhere - in database, for example and contain some key in get request, which would point on this pattern.

Quanzi
  • 16
  • Thanks Quanzi, I would go for 2) if there is no more generic approach. The search criteria has quite many parameters. – Marcel Aug 14 '12 at 14:54
  • Hope that will help you. Try not to overload database, though, think about performance. – Quanzi Aug 14 '12 at 15:01