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
What is custom attribute?
Describe the differences between the lifecycles of Windows services and Standard EXE?
What is jade template engine?
What are session objects?
Will session work if cookies is disabled?
Explain exception filters?
Define globalization and localization.
What is the use of HttpHandlers? When to use this?
How can you implement encapsulation in asp.net?
How to prepare culture-specific formatting in .net.
What is a form tag?
What is a global postback url?
What is in a session cookie?
Can any body provide me the sample web application in asp.net
Why would anyone need to implement their own hashtable or linked list?