Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Is it possible to prevent a browser from caching an ASPX
page?

Answers were Sorted based on User's Feedback



Is it possible to prevent a browser from caching an ASPX page?..

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

Is it possible to prevent a browser from caching an ASPX page?..

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

Is it possible to prevent a browser from caching an ASPX page?..

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

Post New Answer

More ASP.NET Interview Questions

Define a web service in .net?

0 Answers  


What are type/key pairs in client script registration?

0 Answers  


What is viewstate information stored?

0 Answers  


What is the function used for removing an event listener?

0 Answers  


Where session variables are stored?

0 Answers  


asp.net interview questions

0 Answers  


Define WCF ABC , Diffrent Contract. Diff b/w Wcf and in webservice

2 Answers   Syntel,


How to add DateTime Control in normal DataGrid Server Control?

0 Answers  


detail code for sql data connections?

2 Answers  


What is .net remoting?

0 Answers  


What is the difference between system.stringbuilder and system.string

0 Answers  


What is the latest version of asp.net?

0 Answers  


Categories