Friday, July 18, 2008

Prevent Caching of WebPage in Asp.net

Prevent Caching of .aspx page

private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
}
}

No comments: