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
How do you handle server controls?
Give a few examples of page life cycle events.
Differentiate between namespace and assembly.
What is the difference between a candidate key and primary key?
What is application in asp net?
What is the difference between typeof() vs gettype()?
Can we have a web application running without web.config file?
What are the features that make asp.net more used framework? : asp.net mvc
How to set the pane area to transparent of a scrollPane component.?
What is a reflection?
What is the difference between user control and custom control?
What is a 401 redirect?
What is session object? Describe in detail.
Why do you use the app_code folder in asp.net?
What is use of <% %> in asp.net?