Force aspx page to load from server--not cache

W

William LaMartin

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">.
 
W

William LaMartin

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.NoCache
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top