Thursday, March 29, 2012

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,Hi,
You can put this in your page_load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(false)
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"
<mustufa@.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,
>
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" <mustufa@.benepen.com> wrote in message
news:%234gTiVvNFHA.2392@.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,
>
>
Hi Mike,
I tried but the following is nt valid:
Response.Cache.SetAllowResponseInBrowserHistory(false)
Thanks.
"Mike Douglas" <mikedouglas@.doitconsultants.com> wrote in message
news:jdar41lbfqmlvls0lnp07j0leiaekipvph@.
4ax.com...
> Hi,
> You can put this in your page_load
> Response.Cache.SetCacheability(HttpCacheability.NoCache)
> Response.Cache.SetAllowResponseInBrowserHistory(false)
> 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"
> <mustufa@.benepen.com> wrote:
>
or
>
Hi Steve,
Response.Expires = 0 is provided for backward compatibility. Whats the new
way of getting this functionality?
Thanks.
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eFhEodxNFHA.3668@.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" <mustufa@.benepen.com> wrote in message
> news:%234gTiVvNFHA.2392@.TK2MSFTNGP10.phx.gbl...
acheive
>

0 comments:

Post a Comment