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.No Cache)
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 2 6938
Clear your browser cache. You may have some funky old stuff cached in there
since you've been messing around with this stuff.
Then try this code:
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Promenade" <pr******@adinet.com.uy> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... 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.No Cache) 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
Steve, thank you for your response. I'm sorry to say that didn´t work.
I don't even have a clue of what is happening here, maybe I'm doing
something wrong, the odd thing is that it worked once.....
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OB**************@TK2MSFTNGP09.phx.gbl... Clear your browser cache. You may have some funky old stuff cached in
there since you've been messing around with this stuff.
Then try this code: Response.Expires = 0 Response.Cache.SetNoStore() Response.AppendHeader("Pragma", "no-cache")
-- I hope this helps, Steve C. Orr, MCSD, MVP http://Steve.Orr.net Hire top-notch developers at http://www.able-consulting.com "Promenade" <pr******@adinet.com.uy> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... 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.No Cache) 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: neurologic |
last post by:
Hi there,
I'm wondering if it's possible to change the content type of a
HttpResponse after the call to getWriter has been made? What I'm
trying to do is upload a file, and then once it has bee...
|
by: prakash |
last post by:
Hi All
Can anyone explain the difference between Response.Expires & Session.Timeout
Regards
Prakash
|
by: Greg |
last post by:
Hi
I'd like to stop a particular ASP page from being stored in the history so
visitors cannot use their browser's back button to return to it. I've used
Response.Expires = 0 along with this:
...
|
by: Jenny |
last post by:
Need urgent help for an unsolved problem. In our ASP web application,
we creat a Back button and if user click on this button, it execute
history.go(-1) to go back to the previous page. All our...
|
by: qqq |
last post by:
I need a page to be refreshed, even if the user navigates back to it with
the 'Back' button in the browser. I've put "Reponse.expires=0" in the
Page_load event, but the desired refresh isn't...
|
by: Timo |
last post by:
After reading KB234067, I am trying to replace this:
<META http-equiv="CACHE-CONTROL" content="NO-CACHE">
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Expires" content="0">
...
|
by: PD |
last post by:
I am trying to stream out a PDF file via the response object and when I
execute the code it always brings up the first document that I pulled
up.Even when I step through the code, I can see the new...
|
by: gigi |
last post by:
How to send more than one value using response redirect?
For example i can send one like this
response.Redirect "pregled.asp?ime=" & strUserName
but how to send two or more values?
I tried...
|
by: elliott |
last post by:
Hello,
I'm trying to use a C# IHttpModule to install a Response filter
however IIS keeps removing the Content-Encoding header from the
response; but all the other headers I set stay intact.
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |