Click to See Complete Forum and Search --> : Warning: Page has Expired


faamugol
06-07-2004, 10:55 AM
Hello all members,

The error occurs when a user enters some form
data but something turns out to be invalid, and they click the Back button to go back to their form. The user then receives that error and is then asked to Refresh. If they do not refresh, the form data they've entered is lost.

Is there a way to prevent that error message and keep the form data
available (without a lot of additional coding)? The page is not encrypted.

I work with IE version 6 and windows 2000.

Thanks in advance

lmf232s
06-07-2004, 01:42 PM
How are you posting you pages, Post or get?

Do you have anything at the top of you page.

Like

Response.CacheControl = "no-Cache"
Response.AddHeader "Pragma" , "no-cache"
Response.ExpiresAbsolute = Now() -1

This code above, once the page is submited and you are redirected to a new page and then try clicking the back button. You will get the message you just described.

I have this code on a screen that allows the user to enter data and save it to the database.
I have the code to keep the user from entering some data, saving (then they are redirected), and then clicking the back button and by some dumb chance have the user hit save again. Well the user just dupped a record.

Their are other ways to acomplish this task but the code above basically caches the page and does not reload when the back button is pressed, giving you the message you are getting.

Later.

faamugol
06-08-2004, 04:13 AM
thank you for your answer, I' m using POST and Get because I have many pages linked to each other.

I have also tried :<%Response.CacheControl="Public"%> but it does not solve the probleme.

any idea would be appreciated

buntine
06-08-2004, 08:20 PM
The page cannot be displayed because it relies on data that no longer exists. You can get around this problem, though; it will take alot of extra coding. :(

You could alter the code on your initial page.