I am trying to set a page to expire if the back button is pressed..I cant get the code to fire off..I have waited aeveral minutes and the page still wont expire..
Hi,
I have the similar thing to b implemented.All the pages of the application are supposed to b expired.i had written the following code in global.asax.
protected void Application_BeginRequest(Object sender, EventArgs e)
{
// Fires at the beginning of each request
//this help you out in getting refreshed page always
Response.Buffer = true;
Response.Expires = -1000;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.AddHeader("pragma", "no-cache");
Response.AddHeader("cache-control", "private");
Response.CacheControl = "no-cache";
}
try this.i hope it will give u the desired result.
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Response.Buffer = True
Response.Expires = -1000
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1)
Response.AddHeader("pragma", "no-cache")
Response.AddHeader("cache-control", "private")
Response.CacheControl = "no-cache"
End Sub
Yea - that warning is displayed if you try to re-view a page that was the response from a POST request. Those are annoying. what you have now is that the page will always be refershed (another GET request issued by the browser) when you go back to it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.