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
Where code pages are used?
What is difference in .net 1.1 and .net 2.0?
What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?
8. Why do you want to work here?
What is rending process in ASP.NET?
Define a static class?
Can we override the enablepartialrendering property of the scriptmanager class?
Which method is used to force all the validation controls to run?
Is it possible to change the index of primary key on table?
What is difference between abstract class and an interface?
Describe paging in asp.net?
What is the parent class of all the web server control?
What are the different properties of server control that exists?
Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?
In your ASP.NET 2.0 web application you want to display an image that is selected from a collection of images. What approach will you use to implementing this?