PDA

Click to See Complete Forum and Search --> : how to disable the page if user push 'back'


temp_12000
Jul 21st, 2004, 02:21 PM
how to disable the page if user push 'back'

I have an aspx page. A user can push 'logout' button to logout. However, after logout, if the user push 'back' botton in IE's menu, the IE will show the aspx page before logout. How can I prevent this? So, after logout, even user push 'back', it won't show the page.

thanks

mendhak
Jul 22nd, 2004, 01:20 AM
Response.Cache.SetCacheability(HttpCacheability.NoCache)

venerable bede
Jul 22nd, 2004, 04:33 AM
I didn't know that.
Nice one froggo

mendhak
Jul 22nd, 2004, 06:42 AM
What do you normally use?

temp_12000
Jul 22nd, 2004, 10:54 AM
Originally posted by mendhak

Response.Cache.SetCacheability(HttpCacheability.NoCache)


thanks. however, where should I use it?

For example, I have 3 pages,
1st is for login, 2nd is for some processing, 3rd is for logout.
on the 2nd page, it has some buttons. when users push button, it will do some computation. Now, I put
Response.Cache.SetCacheability(HttpCacheability.NoCache)

at the beginning of each page's page_load event. after users logout, if the user push 'back' on IE, it shows 'the page expires .....'. However, if the user push 'back' again, the 2nd page shows up and the user can still use those buttons to do computations.

Is there a sample project for using
Response.Cache.SetCacheability(HttpCacheability.NoCache)

thank you very much.

mendhak
Jul 23rd, 2004, 01:17 AM
Here's a sample:

http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx

I could suggest another way...


<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">