Response.Buffer = true;
        Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "No-Cache");这样为什么不能清楚浏览器缓存?请高手指教。

解决方案 »

  1.   

    也就是这样的问题。我现在想禁用浏览器后退功能,我查了一下。
    大家都是这样写的
      (1)   Response.Buffer = true;
                Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
                Response.Expires = 0;
                Response.CacheControl = "no-cache";
                Response.AddHeader("Pragma", "No-Cache");
        (2) HTML方法
            <HEAD>
            <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
            <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
            <META HTTP-EQUIV="Expires" CONTENT="0">
            </HEAD>
    我按照这样的方法写 还是能够后退的原来的页面上去。
      

  2.   

    禁用缓存<META content=no-cache>
    <META http-equiv=Cache-Control content=no-cache>
    <META http-equiv=Expires content=0>Response.Cache.SetNoStore();  
    Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);  
      

  3.   

    在每次处理之前或处理之后都添加一行代码:
    //C#清除本地浏览器缓存
    Response.Cache.SetCacheability(HttpCacheability.NoCache);这样应该就可以了
      

  4.   

    禁用缓存<META content=no-cache>
    <META http-equiv=Cache-Control content=no-cache>
    <META http-equiv=Expires content=0>Response.Cache.SetNoStore();  
    Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);  这个网上一搜一大把
      

  5.   

    location.href= "abc.aspx?no-cache="+ Math.random()