473,835 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Force aspx page to load from server--not cache

I have an aspx page, A.aspx, that uses some xml. The source of the xml is
another aspx page, B.aspx. B.aspx is populated with xml by code that
depends on several Session variables.

This all works fine the first time you load A.aspx. however, on subsequent
times--with changed session variables--A.aspx is the same, as is B.aspx, if
you check it. However, B.aspx is not really the same, since if you refresh
the browser, B.aspx will then display the new xml as it should for the new
session variables.

How can I force the B.aspx page to not be produced from cache when it is
requested by A.aspx? There is no HTML on it so I cannot use something like
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">.
Jun 27 '08 #1
1 5641
I found the solution: Put the following vb code in the load event for the
aspx page in question (B.aspx)

Response.Cache. SetCacheability (HttpCacheabili ty.NoCache
"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:O6******** ******@TK2MSFTN GP04.phx.gbl...
>I have an aspx page, A.aspx, that uses some xml. The source of the xml is
another aspx page, B.aspx. B.aspx is populated with xml by code that
depends on several Session variables.

This all works fine the first time you load A.aspx. however, on
subsequent times--with changed session variables--A.aspx is the same, as
is B.aspx, if you check it. However, B.aspx is not really the same, since
if you refresh the browser, B.aspx will then display the new xml as it
should for the new session variables.

How can I force the B.aspx page to not be produced from cache when it is
requested by A.aspx? There is no HTML on it so I cannot use something
like <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">.

Jun 27 '08 #2

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

Similar topics

3
3274
by: feng | last post by:
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...
6
2823
by: T. Seaburn | last post by:
I have an aspx page that is always invoked by Response.Redirect calls from other pages. I want my aspx page to always display in a new browser window. Since the Response.Redirect calls from the other pages can't inoke _blank as a target value, is there any way I can ensure that my aspx page always displays in a new browser window without using javascript? Thanks, Tina
5
1802
by: venky | last post by:
Hi, I have a question, i have a web control in my web page. Let say i have page pag1.aspx and control.ascx and page1 contains control. I have written code on the page load of page and also the control but page1 page load is never called. Is there any reason or any setting i need to do to ? venky
15
10101
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the popup has a DataGrid on it and the page.load function DataBinds as you'd expect. I have Code-Behind in C# to emit a call to a JavaScript function which
1
1362
by: AT | last post by:
I have an aspx page with this code behind Public Class WebForm1 Inherits Class1 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Derived Return End Sub
4
2548
by: Paul Drummond | last post by:
Is there a way to force a page refresh, so users will not receive a cached version of a page, even if they have their browser set to never check for a newer version of page? Thank you!
1
365
by: moondaddy | last post by:
I had to repost this becuase I renewed-changed my msdn alias. Also, the asnwer in the other past did not understand what I'm trying to do, so I'll attempt to clarify. I have a .net 2.0 winforms app that calls a web service which creates creates a GUID and caches it, then passes the GUID back to the winform. then it opens a aspx page and passes the GUID as a parameter. this GUID is only cached for about 10 seconds and must be still...
1
1808
by: Ciri | last post by:
Hi, I have a simple html scenario: <html> <head> </head> <body> <img src="myImage.png"> </body> </html> I want a script that forces the re-loading of the page each time myImage.png is changed via ftp.
2
2000
crabpot8
by: crabpot8 | last post by:
I am working on a message system that will let out programmers easily output a message to any user. It works fine, unless the message is requested inside of a page_load on an aspx page. Then, it does not render at all. The code does step through, and the control is added - I believe it might be being added to late in the page lifecycle to get rendered. I can't seem to find any way to tell .NET to render that control, however. ...
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10815
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...
1
10563
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9348
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 project—planning, coding, testing, and deployment—without 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
7770
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
6970
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
5640
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...
0
5808
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4435
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

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.