troubleshooting Question

How do I control Cache in ASPX page and code behind similar to ASP

Avatar of sbornstein2
sbornstein2 asked on
ASP.NET
1 Comment1 Solution499 ViewsLast Modified:
How would I complete this via ASP.Net VS ASP.   What I am trying to do is prevent a user from using their back button on the browser.  The ultimate thing I would like to do is if the user hits the back button possibly keep them on the page they are on, maybe a redirect or something.   If you know how I can handle that then that would be a huge help.  Otherwise I want to expire the page if the user hits the back button.  I am using many Session variables just FYI I dont want to lose the session variables I guess.   The following is what I think can be completed in regular ASP.  Any ideas all?

<html>
<head>
  <meta http-equiv="Expires" CONTENT="0">
  <meta http-equiv="Cache-Control" CONTENT="no-cache">
  <meta http-equiv="Pragma" CONTENT="no-cache">
</head>
===============================================================

Response.Buffer = True
  Response.ExpiresAbsolute = Now() - 1
  Response.Expires = 0
  Response.CacheControl = "no-cache"
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros