954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to expire previous page

I need to expire previous page so that my users cannot go back to the previous and change the data inside it.Can anyone give me some idea or example on doing this?

johnsonlim026
Newbie Poster
5 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Are you using any Authentication?
Do you want to expire the cookies?

Letscode
Junior Poster
175 posts since Feb 2005
Reputation Points: 11
Solved Threads: 6
 

no..i don't use any authentication.Must I use authentication or expire the cookies?

johnsonlim026
Newbie Poster
5 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

No you dont actually need Authentication to clear the cache.If you use authentication you can have better control on your application.

For your application ,
Just add this code to the page load.

Response.Buffer = True
        Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0))
        Response.Expires = 0
        Response.CacheControl = "no-cache"


What happens is It prevents the page from being cached.so that the page will be loaded as a new page rather than taking values from the cache.

Letscode
Junior Poster
175 posts since Feb 2005
Reputation Points: 11
Solved Threads: 6
 

previous page is still opening using this code.

psmitra
Newbie Poster
1 post since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

on load event of each page use "no-cache" problem is it will maintain zero cache but work properly

hirenpatel53
Posting Whiz in Training
221 posts since Jun 2010
Reputation Points: 10
Solved Threads: 27
 

Response.Expires = -1
Response.Cache.SetNoServerCaching()
Response.Cache.SetAllowResponseInBrowserHistory(False)
Response.CacheControl ="no-cache"
Response.Cache.SetNoStore()

sudheer06mca
Newbie Poster
1 post since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You