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


Please Help Members By Posting Answers For Below Questions

What is IPostBack? How to use it?

608


What are the cookies types in asp.net?

568


Explain the difference between webfarm and webgardens in .net?

556


What is synchronous and Asynchronous post back ?

656


How many types of cookies are there in asp.net?

545






Explain the difference between asp & asp.net.

557


Explain what benefit does your code receive if you decorate it with attributes demanding specific security permissions?

539


while developing webservices if i want some users to use my webservice only how can i give security to my webservice?

1418


What are the new features implemented in ASP.NET?

612


What are demand-paging and pre-paging?

588


What is ASLM?

691


Explain what does mvc represent in asp.net? : asp.net mvc

512


What is base class of .net?

546


Difference between response.redirect and server.transfer?

562


how to implement some securty aspect in our application i.e 1.cookie poisioning. 2.data encryption. 3.forcefull browsing 4.sql/code injection 5.securing web app by using web services ........my question is how to implement these thing in our application is this done by hard coding or by help of some tool

1653