P
Promenade
Hi, everyone...
I want to avoid the user to use the navigator back button.
For that reason, I tried all the possible ways to set the Expires property
of the Response Object, but whatever I do, it does not work for me.
In fact, it does work once, the first time I wrote these lines in the
Application_BeginRequest event of the Global.asax file:
Response.Buffer = True
Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0))
Response.Expires = 0 'or -1
Response.CacheControl = "no-cache"
But since I re-compiled the code, it never worked again.
I also wrote these lines everywhere:
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(Now())
In the Page:
Page_Load
Page_PreRender
In the Global.asax:
Session_Start
Application_BeginRequest
Application_AuthenticateRequest
Application_Error
Session_End
Global_AcquireRequestState
I also had tried with the following code:
Response.AddHeader("Pragma", "no-cache")
Response.AddHeader("Expires", "-1")
Nothing.
I appreciate any suggestion.
Promenade
I want to avoid the user to use the navigator back button.
For that reason, I tried all the possible ways to set the Expires property
of the Response Object, but whatever I do, it does not work for me.
In fact, it does work once, the first time I wrote these lines in the
Application_BeginRequest event of the Global.asax file:
Response.Buffer = True
Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0))
Response.Expires = 0 'or -1
Response.CacheControl = "no-cache"
But since I re-compiled the code, it never worked again.
I also wrote these lines everywhere:
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(Now())
In the Page:
Page_Load
Page_PreRender
In the Global.asax:
Session_Start
Application_BeginRequest
Application_AuthenticateRequest
Application_Error
Session_End
Global_AcquireRequestState
I also had tried with the following code:
Response.AddHeader("Pragma", "no-cache")
Response.AddHeader("Expires", "-1")
Nothing.
I appreciate any suggestion.
Promenade