Since I don't know the entire design, I'd have to say that I'm not sure if this is the correct usage for Cache object. You can use ViewState which is tightly coupled to the Page itself. Cache should be used for things that stay longer than just a lifetime of a Page interaction I think.
In any case, you can choose to do a window.open in the window.onbeforeunload event to a cache cleaner utility page that will close itself once it's done
or you can do something different like detecting the page url and it's referrer to see if it's coming from the same page on the destination page like so...
1 if (Request.UrlReferrer != null)
2 {
3 if (Request.UrlReferrer.AbsolutePath != Request.Url.AbsolutePath)
4 {
5 Response.Write("I am coming from a different page, clear the cache");
6 }
7 else
8 {
9 Response.Write("I am coming from the same page, do nothing");
10 }
11 }
Jimmy Chandra
Blogging at
Incoherent RamblingMark this post as Answer if you think it helped you solve the problem.