473,385 Members | 1,693 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,385 software developers and data experts.

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 5609
I found the solution: Put the following vb code in the load event for the
aspx page in question (B.aspx)

Response.Cache.SetCacheability(HttpCacheability.No Cache
"William LaMartin" <la******@tampabay.rr.comwrote in message
news:O6**************@TK2MSFTNGP04.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
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...
6
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...
5
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...
15
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...
1
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 '...
4
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
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...
1
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...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.