Is it possible to prevent a browser from caching an ASPX
page?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the use of SmartNavigation property?
What is three major points in WCF?
Explain how to prepare culture-specific formatting in .net.
Difference between mvc2 and mvc3 in asp.net?
where is declare global variable in asp.net and what is use of global variable
Explain the main function of razor in asp.net? : asp.net mvc
I have a webform in asp.net.In that webform there is 2 division class(DIV).in one of the div class there is a text box for enter the id & a button for to check id with database value.My doubt is that how can i appear the 2nd Div contents only when the id is true with database value.if wrong do not display the div . i Want code in c#.
What are the merits and demerits of viewstate?
When does a session actually start?
What are the asp.net objects? is it application obects, cache objests etc. or is it state managements, web services etc?
How do you declare static variable?
What are session state modes? List some of the important session state modes of asp.net.
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)