0

I have a problem with an asp.net site (4.0 framework) I would like to understand how to properly discard of values in HttpRuntime.Cache between page requests. I am storing values for pagination , control state etc on a search page, and it works fine .. except the values for controls exist (eg. combo box selection) if i open a different browser and open the page.

mike
  • 67
  • 2
  • 5

2 Answers2

0

You should not be using Cache in this way. Not only is it cross-browser-window... it applies to the whole application.

You should use querystring/form values for saving which page is being viewed, instead.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
0

If you want a storage per session, the HttpContext.Current.Session is a good place to put it. As Andrew Barber points out, the Cache is application-wide (shared by all users and sessions)

Erik A. Brandstadmoen
  • 10,430
  • 2
  • 37
  • 55