Search

Sep 4, 2007

How to expire previous page

Hello all,

This is the normal problem we all are facing in Web application.

Problem comes when user use back button of browser and application start malfunctioning.

Just add following code in page load

Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.Subtract(new TimeSpan(0, 0, 2));
Response.Expires = 0;
Response.CacheControl = "no-cache";

No comments: