提交网页的网页过期功能是怎么做的?

KITTY852 2010-10-27 10:22:34
提交网页的网页过期功能是怎么做的?
...全文
54 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
response.setHader("Expires","0");
wuyq11 2010-10-27
  • 打赏
  • 举报
回复
<META content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>

Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Response.Expires = 0;
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
Response.AddHeader("pragma", "no-cache");
Response.CacheControl = "no-cache";
wjq 2010-10-27
  • 打赏
  • 举报
回复
页面的page load部分加入如下代码
protected void Page_Load(object sender, EventArgs e)
{
Response.Expires = 0;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.AddHeader("pragma", "no-cache");
Response.CacheControl = "no-cache";
}

17,740

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧