Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi there
How do I...show “webpage has expired” on back or refresh buttons
thanks...
Posted
Comments
Kornfeld Eliyahu Peter 8-Jun-14 5:38am    
A web page can be expired or not. When id does browser will try to fetch it from the server before displaying 'expired' message...
So basically you do not show 'expired' message at any time...
You may elaborate on what you try to do so we may help you with...
karthik Udhayakumar 8-Jun-14 11:50am    
Unclear:(Improve Question

1 solution

Mehdhi,
Not very clear but I guess this is what you are looking for

Add these lines in Pageload

C#
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now);


The above code will disable page cache,when back/Forward button is clicked,the current page will expire:)
 
Share this answer
 
v2
Comments
ZurdoDev 8-Jun-14 21:30pm    
This is true but I don't think it guarantees that the browser will show that message. Depending on IE settings, for example, IE may see it expired and just request it again and therefore the message will be shown.

+5 though since this is probably the best answer we can give based on the information provided.
karthik Udhayakumar 9-Jun-14 3:22am    
Thanks Ryan:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900