473,398 Members | 2,403 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,398 software developers and data experts.

Setting Page Expiration...

Hi,

Whenever the user clicks on Back Button, I want that page to be reloaded or
refreshed. Basically I don't want my page to be cached. How can I acheive
this functionality in asp.net?

Regards,

Nov 19 '05 #1
4 1049
Hi,

You can put this in your page_load

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(fa lse)

This will make the so the page is expired.

I hope this helps.

Mike Douglas

www.doitconsultants.com

On Fri, 1 Apr 2005 14:59:04 -0500, "Mustufa Baig"
<mu*****@benepen.com> wrote:
Hi,

Whenever the user clicks on Back Button, I want that page to be reloaded or
refreshed. Basically I don't want my page to be cached. How can I acheive
this functionality in asp.net?

Regards,


Nov 19 '05 #2
This will ensure the page doesn't get cached.

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Mustufa Baig" <mu*****@benepen.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

Whenever the user clicks on Back Button, I want that page to be reloaded
or
refreshed. Basically I don't want my page to be cached. How can I acheive
this functionality in asp.net?

Regards,

Nov 19 '05 #3
Hi Mike,

I tried but the following is nt valid:

Response.Cache.SetAllowResponseInBrowserHistory(fa lse)

Thanks.

"Mike Douglas" <mi*********@doitconsultants.com> wrote in message
news:jd********************************@4ax.com...
Hi,

You can put this in your page_load

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetAllowResponseInBrowserHistory(fa lse)

This will make the so the page is expired.

I hope this helps.

Mike Douglas

www.doitconsultants.com

On Fri, 1 Apr 2005 14:59:04 -0500, "Mustufa Baig"
<mu*****@benepen.com> wrote:
Hi,

Whenever the user clicks on Back Button, I want that page to be reloaded orrefreshed. Basically I don't want my page to be cached. How can I acheive
this functionality in asp.net?

Regards,

Nov 19 '05 #4
Hi Steve,

Response.Expires = 0 is provided for backward compatibility. Whats the new
way of getting this functionality?

Thanks.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:eF**************@TK2MSFTNGP14.phx.gbl...
This will ensure the page doesn't get cached.

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Mustufa Baig" <mu*****@benepen.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

Whenever the user clicks on Back Button, I want that page to be reloaded
or
refreshed. Basically I don't want my page to be cached. How can I acheive this functionality in asp.net?

Regards,


Nov 19 '05 #5

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

Similar topics

0
by: | last post by:
Which of these scenarios is better: A -- User Registers and is returned to the login screen to test his new username ie (email address). A login script checks user name against database....
4
by: Rickey Tom | last post by:
This has to be a very common question, but my search did not come up with an answer. I needed to set an expiration time for a cookie. In .NET, is seems that the server-side code is used to set...
5
by: Kenneth Keeley | last post by:
Hi, I have a web app that has forms authentication and I can login to the page the first time I go there but it never times me out if I come back in 24 hours a hit the refresh key the page loads...
3
by: naijacoder naijacoder | last post by:
what i need i think its a session timeouts. Which i'm using like:- <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data...
2
by: Bill Borg | last post by:
Hello all, I am working on forms authentication and trying to understand: what's the relationship between the cookie expiration and the ticket expiration? I create a cookie and I add an...
1
by: zorro | last post by:
Greetings, I want users to select the duration time of their sessions. I'm able to do it by setting the PHPSESSID cookie duration. Is this reliable, or is it not recommended for some reason? ...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
2
by: helveticus | last post by:
How can I assign expiration dates for external js scripts? For instance, I would like to update the expiration date of a js script by one hour after the last fetch. Does this make sense? I have...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a site which I secure with forms authentication. When the user's sign on and hit one of the secure pages, I have this line in my code to ensure that the browser does not cache the page;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.