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 active web page?
Do session use cookies in asp net?
What is ispostback method in asp.net? Why do we use that?
What is parse in asp.net?
What is the life cycle of an asp.net page?
What are early binding and late binding.
8. Why do you want to work here?
Explain how cookies work. Give an example of cookie abuse.
What is a master page and what does it do?
What are strong names?
Explain client side state management system.
How do I publish my asp.net application to my isp's web server?
What is an asp.net validator? And, mention its types.
Explain how can we inherit a static member?
What are the various types of validation controls provided by asp.net?