WebBrowser - how to clear session cache?

  • Thread starter Thread starter ESmith
  • Start date Start date
E

ESmith

How can I clear the current session cache of previously visited webpages?

That is, say I start up my app (with browser component), point to
www.cnn.com, click on several links, then I want to programmatically clear
the current session cache so if the user hits the back button, their current
page is now, in reality, the start node and there is nothing to traverse to.
 
If you want to disable back events for your own application, that's not
possible however you can choose to not cache the pages using the pragma no
cache directive. hope this helps.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
 
If Ive understood correctly and you want to stop people going 'back', somewhere on your page you could use the javascript:

history.forward();

no more going back as you are already there.

This does of course need something on your page to put the JS there - you could have a common user control or alternatively in the Render event of a page that wraps what you are viewing you can intercept the construction of the html with a HtmlTextWriter...very useful when you need to retrospectively add common page attributes such as the ie title bar months into development.
 
Back
Top