0

I have tried several ways

 Response.Cache.SetCacheability(HttpCacheability.NoCache); //Cache-Control : no-cache, Pragma : no-cache
    Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); //Expires : date time
    Response.Cache.SetNoStore(); //Cache-Control :  no-store
    Response.Cache.SetProxyMaxAge(new TimeSpan(0, 0, 0)); //Cache-Control: s-maxage=0
    Response.Cache.SetValidUntilExpires(false);
    Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);

    Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
    Response.Expires = -1500;
    Response.CacheControl = "no-cache";

And in aspx page:

     <%@ OutputCache Location="None"  NoStore="true" VaryByParam="None" %>

I have read many answers in the net and they only work for IE and Firefox and not in chrome.

Thank You in Advance

Linta Sheelkumar
  • 195
  • 1
  • 5
  • 21
  • What specifically in Chrome tells you it's using a cached version? Do you have a screenshot of the developer tools network tab on a page load to compare firefox vs chrome? – Neil Nov 29 '17 at 15:39
  • I cannot give a screenshot because of company policy but I can explain it.So I have some radiobuttons in the page for Flight Upgrade like business,first etc.. Suppose I select radiobuttn Business and then goes to next page. Then click back button in browser then the previous radiobuttons(for Business) gets preselected but I dont want that..because it will affect the cost I'm showing – Linta Sheelkumar Nov 29 '17 at 15:47
  • This probably isn't an issue with server caching at all. If your specific circumstance is when the user hits the back button see [this question](https://stackoverflow.com/questions/8861181/clear-all-fields-in-a-form-upon-going-back-with-browser-back-button) for details about how you can auto clear your form selections – Neil Nov 29 '17 at 15:51
  • Because when I disabled caching in IE and Firefox ,I'm getting the desired result..the radiobuttons are not getting preselected. If there is anyway to do it in chrome I'm sure my issue will be resolved. – Linta Sheelkumar Nov 29 '17 at 16:34
  • You need to look specifically for information about `BFCache` or `Back-Forward Cache`, as described in the link from my previous comment. This will almost certainly require a javascript solution – Neil Nov 29 '17 at 16:46
  • I have managed to fix it using window.load function – Linta Sheelkumar Nov 30 '17 at 11:10

1 Answers1

0

This fixed it!I removed the property which was preselected in chrome in load function.

 $jq(window).load(function () {
        debugger;
            $jq('ul.tabs li').find('.radio').removeClass("checked");
            $jq('ul.tabs li:first-child').find('.radio').addClass("checked");
    } );
Linta Sheelkumar
  • 195
  • 1
  • 5
  • 21