ajax中存在缓存的问题

来源:互联网 发布:windows 10能装用友 编辑:程序博客网 时间:2024/05/22 12:04

解决方法如下:

1 xmlHttp.open("POST","XMLHttpServer.aspx,ture);
还有由于asp.net缓存作用,反复请求同一个页面,那么直接从内存中拿,不会继续执行页面后台代码
解决方法:
xmlHttp.setRequestHeader("If-Modified-Since","0");
xmlHttp.send(null);

 

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

即可