Is it possible to prevent a browser from caching an ASPX
page?
Answers were Sorted based on User's Feedback
Answer / manoj
Write this code in the Page load event of the code behind :-
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Is This Answer Correct ? | 5 Yes | 2 No |
Answer / 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 |
Answer / 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 |
what is generics?
Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?
What are session state modes in asp.net?
Define static constructor?
Explain global assembly cache.
Is there any limit for query string? Means what is the maximum size?
What is the use of HttpHandlers? When to use this?
What are different types of api?
What are the Types of chaching. How to implement caching
What are the security types in asp.net?
How can you identify that the page is post back?
main difference between asp.net2.0,asp.net1.1,asp.net1.0
15 Answers Inflexion, Infosys, iSoft, Microsoft, Prakruthi,