Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)); Response.Cache.SetNoStore(); Response.AppendHeader("Pragma", "no-cache"); if (Page.IsPostBack) { if (isPageExpired()) { Response.Redirect("expired.htm"); } else { Session["TimeStamp"] = DateTime.Now.ToString(); ViewState["TimeStamp"] = DateTime.Now.ToString(); } } private Boolean isPageExpired() { if (Session["TimeStamp"] == null || ViewState["TimeStamp"] == null) return false; else if (Session["TimeStamp"] == ViewState["TimeStamp"]) return true; else return false; }
javascript: window.history.forward(1);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)