By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,584 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,584 IT Pros & Developers. It's quick & easy.

Force aspx page to load from server--not cache

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.