Is it possible to save and restore a complete aspx page?

Our clients have this requirement:

  • The search page should be displayed in a modal dialog (iframe) when the user clicks the search icon on the form
  • User can search, view search results and select an entry
  • The modal dialog is now hidden and the user is viewing the post
  • When the user clicks on the search icon again, the modal dialog appears again

Now the part for my question:

  • When the user leaves the current page and comes back through the page after a few minutes and clicks on the search icon again to continue searching, they should see the same page as before.

I prefer to just save the full page and restore it when the user wants to view the search page again. But I don't know if this is possible.

I really don't want to save all the search filters and search again when the user navigates to the search page because there are> 100 search filters and the search can run as well.

The strict requirement from the client is that he should continue his search and should not start over every time he goes to the search page again.

Thanks for all the suggestions on this.


source to share

3 answers

It looks like you could have used the .NET page declaration @OutputCache with the VaryByParam attribute set (assuming the search parameters go through at least a sequence of requests.)



I would come up with some kind of custom cache mechanism for storing search results on the server. when the user submits a request, the results are stored in the cache and the key is returned to the page. then when the user clicks the button to re-view the results, fetch the results from the server using the key.



Why don't you store the search results in a session or view variable?

If I was at your position (and unable to store the search results for the session variable), I would:

  • Make the modal dialog your own page.
  • Load the page on the server (the server connects to the modal dialog page and loads the content).
  • Store the loaded page somewhere (maybe a session, but maybe a database or filesystem).
  • Add the iFrame to the modal dialog (make sure you add the name field or it won't work in FF).
  • Set the iFrame source in the modal dialog for the saved search results.

It should be noted that this solution will have problems if the search results use server-side browser-specific controls (controls that return different HTML based on the browser type specified on the server).

If you want the iFrame can be replaced with a div if you set the inner html div to the inner html of the body tags in the saved page.

I believe there is also a built in ASP function that will get the display text of the page, but I don't remember what it was called.



All Articles