Friday, August 09, 2002

Expiring Pages in ASP.NET

These are the methods to force a server request when a page is accessed within the browser. Unfortunately, none of these have worked consistently, and none have had any effect on the browser's BACK button.

Response.Cache.SetCacheability(HttpCacheability.NoCache);

<%@ OutputCache Location="None" %>

this.Response.Cache.SetExpires(DateTime.Now); 

this.Response.Expires = -1;

<meta HTTP-EQUIV="Expires" CONTENT="0">

if (String(Session["SessionUser"]) == "") SignOut();

And lastly, IIS > Default Web Site > Properties > HTTP Headers > Enable Content Expiration


4:43:00 PM  #