473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Expire problem

I have a page (page1.aspx) with some content.
The user select the content and press a next button and is redirected to
another page (page2.axpx).

I wan't that page1.aspx is not redisplayed when i press the back button in
my browser when i am in page2.aspx.

How do i do this?

thanks,
Gonçalo Boléo
Nov 19 '05 #1
2 1175
Normally code like this can be used.

<%
System.Web.HttpContext.Current.Response.AddHeader( "Cache-Control","no-cache"
)
System.Web.HttpContext.Current.Response.Expires = 0
System.Web.HttpContext.Current.Response.Cache.SetN oStore()
System.Web.HttpContext.Current.Response.AddHeader( "Pragma", "no-cache")%>

However, expiry is rarely a very reliable thing depending on the browser,
its worth reading this:

http://www.mnot.net/cache_docs/

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Gonçalo Boléo" <gb****@netcabo.pt> wrote in message
news:uh**************@TK2MSFTNGP11.phx.gbl...
I have a page (page1.aspx) with some content.
The user select the content and press a next button and is redirected to
another page (page2.axpx).

I wan't that page1.aspx is not redisplayed when i press the back button in
my browser when i am in page2.aspx.

How do i do this?

thanks,
Gonçalo Boléo

Nov 19 '05 #2
Gonçalo Boléo wrote:
I have a page (page1.aspx) with some content.
The user select the content and press a next button and is redirected
to another page (page2.axpx).

I wan't that page1.aspx is not redisplayed when i press the back
button in my browser when i am in page2.aspx.

How do i do this?


In general, you can't. Quoting the HTTP 1.1 spec:

"[...] a history mechanism is meant to show exactly what the user saw
at the time when the resource was retrieved".

Not that most browsers actually implement this behaviour -- AFAIK only
Opera does. Other browsers can be convinced at least to reload the page
by making it non-cacheable (see John's post). But trying to make the
page disappear requires additional logic for page1.aspx.
Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
1
by: HorseGeek | last post by:
I have three servers: Server1, Server2, and Server3. There is a login cookie does not expire for SOME users on Server2. Ironically, the login cookie expires correctly for ALL users on the...
7
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local...
3
by: Joey Powell | last post by:
This message was originally posted to the aspnet.security newsgroup, but no one there has ever heard of this before. That is why I am posting this message here, so that more people will see it... ...
4
by: TCORDON | last post by:
How can I expire a page so if a user click back for example the page shows message "This Page has expired" or better yet a peronalized "Page expired" page. TIA!
23
by: Phil Powell | last post by:
// OBTAINED FROM http://www.javascripter.net/faq/settinga.htm // NOTE THAT IF YOU SET days TO -1 THE COOKIE WILL BE SET TO YESTERDAY AND THUS EXPIRE function setCookie(name, value, days, docObj)...
32
by: paul | last post by:
HI! I keep on getting this error and I have tried different things but I am not sure how to send the expiring date. The error that I am getting in Firefox 1.5 is "Error: expires.toGMTString is...
1
by: Polani | last post by:
Hi Guys , I am taking DB2 Online backups through TSM API daily. When i check the database configuration parameters , it shows me " Number of database backup verions to maintain"= 12. This is...
0
by: aspineux | last post by:
setacl and getacl look to be already "Cyrus" specific (according the doc), why not to extend imaplib a little bit more ? Here are some code I wrote and tested to support cyrus "expire" that...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
marktang
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,...
0
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...
0
Oralloy
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.