Is it possible to prevent a browser from caching an ASPX
page?

Answer Posted / swapna

Just call SetNoStore on the HttpCachePolicy object exposed
through the Response object's Cache property, as
demonstrated here:

<%@ Page Language="C#" %>

<%
Response.Cache.SetNoStore ();
Response.Write (DateTime.Now.ToLongTimeString
());
%>


SetNoStore works by returning a Cache-Control: private, no-
store header in the HTTP response. In this example, it
prevents caching of a Web page that shows the current time.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Diff between web user control and web custom control?

496


Where do the cookie state and session state information be stored?

510


What is a postback in asp net?

531


Explain about Application and Session Events ?

635


Explain the difference between singleton and single call?

532






What is OSI layer? Explain different layers.

601


What is state management technique?

539


Why is string called immutable data type?

589


Explain the steps to be followed to use passport authentication.

587


is there any third party tools are using in .net technologies? what are there ? give me the brief introduction?

1948


What do you mean by caching in asp.net?

548


How would you enable impersonation in the web.config file?

540


How can we inherit a static member?

590


What is a user session?

497


How is mvc different from asp.net? : Asp.Net MVC

547