Is it possible to prevent a browser from caching an ASPX
page?
Answer Posted / surendra singh
Just call SetNoStore on the HttpCachePolicy object exposed through the Response object's Cache property, as demonstrated here:
<%@ Page Language="C#" %>
<html>
<body>
<%
Response.Cache.SetNoStore ();
Response.Write (DateTime.Now.ToLongTimeString ());
%>
</body>
</html>
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 ? | 0 Yes | 0 No |
Post New Answer View All Answers
9. Why should we hire you over the others waiting to be interviewed?
What is preprocessor in .net and type, where it use?
Define globalization and localization.
What are the authentication types in asp.net?
What is the server of asp.net?
What is webresource axd?
Explain what is the procedure to create the environment for asp.net? : asp.net mvc
Who can consume WebAPI?
What are the Types of objects in ASP
What is the function used for removing an event listener?
What is the purpose of master page?
What is asp short for?
What is state management techniques in asp.net?
What’s the catch?
What is a nested masterpage in asp.net 2.0? Can there be a master page inside a masterpage?