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 publisher?
What is hidden field in asp.net?
What is the difference between page directive include and action tag include?
Give 2 examples for scenarios when routing is not applied?
Why asp.net is better than php?
Explain what is an abstract class?
Tell me the code snippet to show how we can return 404 errors from HttpError?
What is http request and response?
Can the validation occurs in server-side or client-side? If the validation occurs why should we do?
What is asp.net with mvc? : Asp.Net MVC
Explain how does asp page work?
How would you get asp.net running in apache web servers? Explain it's limitations.
Is asp.net still used?
What is the most appropriate lifetime for a database connection/orm context in an asp.net mvc application? : Asp.Net MVC
What are the differences between the response.write() and response.output.write()?