473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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.aspx' is the aspx page I
am talking about:

<script language='javascript'>
window.showModalDialog
('Open/QicWebError.aspx', '_blank', 'height=380,
width=490', true);
</script>

Nov 18 '05 #1
3 3245
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*******@discussions.microsoft.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.aspx' is the aspx page I
am talking about:

<script language='javascript'>
window.showModalDialog
('Open/QicWebError.aspx', '_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*******@discussions.microsoft.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.aspx' is the aspx page I
am talking about:

<script language='javascript'>
window.showModalDialog
('Open/QicWebError.aspx', '_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*******@discussions.microsoft.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.aspx' is the aspx page I
am talking about:

<script language='javascript'>
window.showModalDialog
('Open/QicWebError.aspx', '_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
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...
9
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)...
2
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.