ASPX page not always being "called"

E

epigram

This is probably a more general HTML question, but here it goes. We're
creating an asp.net app and noticed that sometimes if an aspx page has
already been visited (say, in a given session) that the page doesn't
actually get requested from the web server. In other words, we have
breakpoints on the page's constructor, init, pageload, etc. and they don't
get hit when this happens.

I turned off caching in IE ( by changing the Temporary Internet files
Settings via Tools | Internet Options) to see if it was the browser's fault,
and it appears it is. When I turned off caching the aspx page gets executed
on the server every time. So, I want to know how do you deal with this?
Can this be solved with a META tag or similar convention? There are certain
aspx pages we ALWAYS want to be requested so we can execute logic on the
server. So if the browsers, or IIS for that matter, caches the page we'll
be in trouble.

Any help would be much appreciated!

Thanks.
 
G

Guest

Hello,

Are you sure that you are not using "Page.IsPostBack" in the Page_Load?

This seems to work for me with not having pages cache:
Response.CacheControl = "No-cache"

I hope that this is helpful to you,
Charles
 
J

Joerg Jooss

Charles said:
Hello,

Are you sure that you are not using "Page.IsPostBack" in the
Page_Load?

This seems to work for me with not having pages cache:
Response.CacheControl = "No-cache"

That's a rather awful way to do it in ASP.NET. Use the HttpCachePolicy
class instead.

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Cheers,
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top