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
What is a page life cycle? What are the events in a page life cycle?
How do I force the dispose method to be called automatically, as clients can forget to call dispose method?
In early binding will the method invoked on com component will verify it?s existance in the system or not ?
What is GAC in ASP.NET 2.0
What parameters can you pass in the url of the api?
What are the types of authentication in asp.net?
What is the difference between abstract class vs interface? Can give me the real time examples?
What are Caching techniques in .NET
What is the differences between a primary key and a unique key in sql server?
How to automatically get the latest version of all the asp.net solution items from source safe when opening the solution?
What is a reflection?
What is the difference between user control an custom control?
Describe a bubbled event and how it is used ?
What is marshalling ? Is it a part of asp.net ?
What is class and object in asp.net?