Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to prevent aspx page from being cached by user's browser?

Reply
Thread Tools

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

 
 
feng
Guest
Posts: n/a
 
      02-08-2004
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>

 
Reply With Quote
 
 
 
 
Eric Lawrence [MSFT]
Guest
Posts: n/a
 
      02-08-2004
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" <(E-Mail Removed)> wrote in message
news:c75001c3ee0e$4e47b160$(E-Mail Removed)...
> 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>
>



 
Reply With Quote
 
 
 
 
Saravana [MVP]
Guest
Posts: n/a
 
      02-08-2004
Check out this faq,
http://www.extremeexperts.com/Net/FA...ackButton.aspx

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



"feng" <(E-Mail Removed)> wrote in message
news:c75001c3ee0e$4e47b160$(E-Mail Removed)...
> 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>
>



 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      02-08-2004
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" <(E-Mail Removed)> wrote in message
news:c75001c3ee0e$4e47b160$(E-Mail Removed)...
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>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
applets being cached? yawnmoth Java 5 08-15-2006 07:40 PM
Stopping pages from being cached. Adrian Parker ASP .Net 0 03-18-2005 04:32 PM
how can I tell if dropdownlist is really being cached? Hazz ASP .Net 1 03-17-2005 09:01 AM
my cached dataset just wont stay cached!! Craig G ASP .Net 0 03-07-2005 10:02 AM
How can I clear cached ASPX pages from another page? Jim ASP .Net 0 04-05-2004 07:26 PM



Advertisments