0

Hi,

I want to disable the cache in browser using asp.net.If I click the back button of the browser the value of cache should be changed.

Can anyone help on this how to do??

Regards,
Pavan Kumar

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by skyboy
0
<%@ OutputCache Duration="1" VaryByParam="none" %>

You can put this code just under

<%@ Page  Language="C#">

.. Hope this helps..:)

0
<%@ OutputCache Duration="1" VaryByParam="none" %>

You can put this code just under

<%@ Page  Language="C#">

.. Hope this helps..:)

Thanks for the reply

The code i had written in Pageload was:

Response.Cache.SetNoStore();
Response.Cache.SetCacheability(HttpCacheability.NoCache);

The cache disable is working well with the browsers IE,Mozilla,Chrome if i clicked back button;but not in Safari.

0

Your code is correct, but you can use this:

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
HttpContext.Current.Response.Cache.SetCachebility(HttpCacheability.NoCache)
Response.Cache.SetNoStore

But make sure you import system.web.caching.cache

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.