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 the page life cycle in asp.net?
When was asp.net released?
What is view state and how it works in asp net?
Explain an object, class and method.
Explain how can we inherit a static variable?
What are type/key pairs in client script registration? Can there be 2 scripts with the same type/key pair name?
What is aspect-oriented programming?
Why web api is better than wcf?
How to integrate angular 8 with asp.net mvc 5? : Asp.Net MVC
how to retrieve property settings from xml .config file.
What is request and response in asp.net?
How you will handle session when deploying application in more than a server?
Describe briefly what is the role of IIS on an ASP.NET application? What does it for the same application?
Explain asp.net web forms.
Explain asp.net page life cycle?