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 can exception be handled with out the use of try catch?
Explain how can we inherit a static member?
What is the benefit of WebAPI over WCF?
What are Master Pages in ASP.NET?
What are the new web part controls in asp.net 2.0 ?
How do you declare static variable? What is its lifetime?
How would you get asp.net running in apache web servers? Explain it's limitations.
Why asp.net is used?
Explain how caching in asp.net 2.0 is different from caching in asp.net 1.1?
What are web beacons used for?
What does mvc represent in asp.net? : asp.net mvc
To display data in a Repeater control which template you provide?
How does a content page different from a master page?
What are the events that happen when a client requests an asp.net page from iis server?
Explain the different types of assemblies?