现在的位置: 首页 > 综合 > 正文

防止网页后退–禁止缓存

2013年01月17日 ⁄ 综合 ⁄ 共 254字 ⁄ 字号 评论关闭
protected void Page_Load(object sender, EventArgs e)
{
    //防止网页后退--禁止缓存
    Response.Expires = 0;
    Response.Buffer = true;
    Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
    Response.AddHeader("pragma", "no-cache");
    Response.CacheControl = "no-cache";
} 

抱歉!评论已关闭.