Link to home
Start Free TrialLog in
Avatar of sbornstein2
sbornstein2

asked on

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

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"
ASKER CERTIFIED SOLUTION
Avatar of Swapnil
Swapnil
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial