473,804 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to prevent aspx page from being cached by user's browser?

In my ASP.Net app I have a aspx page that's called by an
other page's client side JavaScript code. The problem is
that the first time this page get loaded, it will be
cached in the user's local cache and will not be refreshed
in the following calls. I checked the following calls and
I see that even the page's Page_Load method of the
codebehind will not be invoked.

I also checked that if I clear the browser's cache each
time the page get called, then the following call will be
refreshed.

My question:
1) I have many aspx pages, why only this page has this
issue:
2) What do I do to solve this problem?

Here is the client side JavaScript that calls the this
page, and the 'Open/QicWebError.asp x' is the aspx page I
am talking about:

<script language='javas cript'>
window.showModa lDialog
('Open/QicWebError.asp x', '_blank', 'height=380,
width=490', true);
</script>

Nov 18 '05 #1
3 3272
If you don't specify HTTP expiration using Cache-Control headers or Expires
headers, IE is free to "guess" your intentions.

You can explicitly force your response not to get cached:

See the

Response.Cache. SetExpires
Response.Cache. SetMaxAge
and
Response.Cache. SetRevalidation

members for more info.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
"feng" <an*******@disc ussions.microso ft.com> wrote in message
news:c7******** *************** *****@phx.gbl.. .
In my ASP.Net app I have a aspx page that's called by an
other page's client side JavaScript code. The problem is
that the first time this page get loaded, it will be
cached in the user's local cache and will not be refreshed
in the following calls. I checked the following calls and
I see that even the page's Page_Load method of the
codebehind will not be invoked.

I also checked that if I clear the browser's cache each
time the page get called, then the following call will be
refreshed.

My question:
1) I have many aspx pages, why only this page has this
issue:
2) What do I do to solve this problem?

Here is the client side JavaScript that calls the this
page, and the 'Open/QicWebError.asp x' is the aspx page I
am talking about:

<script language='javas cript'>
window.showModa lDialog
('Open/QicWebError.asp x', '_blank', 'height=380,
width=490', true);
</script>

Nov 18 '05 #2
Check out this faq,
http://www.extremeexperts.com/Net/FA...ackButton.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"feng" <an*******@disc ussions.microso ft.com> wrote in message
news:c7******** *************** *****@phx.gbl.. .
In my ASP.Net app I have a aspx page that's called by an
other page's client side JavaScript code. The problem is
that the first time this page get loaded, it will be
cached in the user's local cache and will not be refreshed
in the following calls. I checked the following calls and
I see that even the page's Page_Load method of the
codebehind will not be invoked.

I also checked that if I clear the browser's cache each
time the page get called, then the following call will be
refreshed.

My question:
1) I have many aspx pages, why only this page has this
issue:
2) What do I do to solve this problem?

Here is the client side JavaScript that calls the this
page, and the 'Open/QicWebError.asp x' is the aspx page I
am talking about:

<script language='javas cript'>
window.showModa lDialog
('Open/QicWebError.asp x', '_blank', 'height=380,
width=490', true);
</script>

Nov 18 '05 #3
Hi,

you can also try putting

<%@ Outputcache Location="None" %>

directive at top of your page's aspx (just after Page directive)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"feng" <an*******@disc ussions.microso ft.com> wrote in message
news:c7******** *************** *****@phx.gbl.. .
In my ASP.Net app I have a aspx page that's called by an
other page's client side JavaScript code. The problem is
that the first time this page get loaded, it will be
cached in the user's local cache and will not be refreshed
in the following calls. I checked the following calls and
I see that even the page's Page_Load method of the
codebehind will not be invoked.

I also checked that if I clear the browser's cache each
time the page get called, then the following call will be
refreshed.

My question:
1) I have many aspx pages, why only this page has this
issue:
2) What do I do to solve this problem?

Here is the client side JavaScript that calls the this
page, and the 'Open/QicWebError.asp x' is the aspx page I
am talking about:

<script language='javas cript'>
window.showModa lDialog
('Open/QicWebError.asp x', '_blank', 'height=380,
width=490', true);
</script>
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2582
by: NotGiven | last post by:
Say you have three pages, a search page, a results/master, and a detail page. You choose parameters on your search page and submit the page. The results show in the reults/master page. You click one to go the details page. You hit the browser button to go back and it shows the results/master page but shows "Page has expired" error. How can you prevent this? How can you show the results page whether you get
9
2296
by: Daniel Walzenbach | last post by:
Hi I am faced with the following problem: I have a page (let’s call this page page1.aspx) containing some TextBoxes and a hyperlink which opens another page (let’s call this page page2.aspx) as a popup using either window.open or window.showModalDialog. Since I want to warn the users of my application when they try to close page1.aspx and have changed the values in the meantime I thought about using the “onbeforeunload” event of the...
2
3884
by: COHENMARVIN | last post by:
I'm writing a database application in asp.net, and I'm worried that the users will sometimes click the BACK button in their browser, thus making some pages re-execute, and possibly messing up the databases. How can this be prevented? Can I prevent prior pages from being cached by the browser, so that the user has to click on REFRESH to see the page again? If I can do that, I would force the prior page to re-execute, and maybe that would...
0
1462
by: helveticus | last post by:
I have a master/details configuration that includes multiple user controls. The details page is configured to cache data via VaryByCustom. This works fine. One of the user controls contains an image button. With caching turned on, the control remains "lame" since the control is only dynamically generated during the first access. My understanding is that page caching directive causes all page user controls to be implicitly cached as...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.