浅析showModalDialog数据缓存问题(用禁止浏览器缓存解决)

  如果要显示最新的数据需要在页面中进行设置,取消缓存。

  在showModalDialog的页面的Head标签内增加如下代码:

  <meta http-equiv="pragma" content="no-cache">

  这样页面就不会被缓存。从而保证了在对数据进行修改后,再次打开页面后显示最新的数据。

  HTML方面

  <meta http-equiv="pragram" content="no-cache">

  禁止浏览器从本地缓存中调阅页面。

  网页不保存在缓存中,每次访问都刷新页面。

  <meta http-equiv="cache-control" content="no-cache, must-revalidate">

  同上面意思差不多,必须重新加载页面

  <meta http-equiv="expires" content="0">

  网页在缓存中的过期时间为0,一旦网页过期,必须从服务器上重新订阅。

  .NET方面

  Response.Expires = -1;