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

Page_Load Not Firing On Subsequent Views of the Page

Just wondering what could cause this: I have observed that when first
opening an aspx page, the Page_Load event fires as expected. Then I go to
other pages in the site. When returning to any page that has been previously
viewed, the Page_Load event does not fire (or at least the Page_Load event
procedure is not executed). FWIW: PostBacks are working fine (meaning that
the Page_Load event procedure executes on PostBacks). The problem is just
when I navigate away to another page and then return to a previously viewed
page.

Please note that I do NOT have output Caching enabled on any of the pages.
Also, while I have not tested every single page in my ASP.NET Web
application, I have observed this behavior in many of them (and none I have
tested show the behavior I expect/need - which is to have Page_Load fire on
every request for the page).

What can cause this? How can I make it so that the Page_Load event procedure
executes on every request for the page?

Thanks!
Nov 18 '05 #1
4 3170
the browser is caching the page itself, thus the server knows nothing about
it.

-- bruce (sqlwork.com)

"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:OP**************@TK2MSFTNGP12.phx.gbl...
Just wondering what could cause this: I have observed that when first
opening an aspx page, the Page_Load event fires as expected. Then I go to
other pages in the site. When returning to any page that has been previously viewed, the Page_Load event does not fire (or at least the Page_Load event
procedure is not executed). FWIW: PostBacks are working fine (meaning that
the Page_Load event procedure executes on PostBacks). The problem is just
when I navigate away to another page and then return to a previously viewed page.

Please note that I do NOT have output Caching enabled on any of the pages.
Also, while I have not tested every single page in my ASP.NET Web
application, I have observed this behavior in many of them (and none I have tested show the behavior I expect/need - which is to have Page_Load fire on every request for the page).

What can cause this? How can I make it so that the Page_Load event procedure executes on every request for the page?

Thanks!

Nov 18 '05 #2
Is there any way I can tell the browser to NOT cache the page? Or is doing
that generally frowned upon?

-G
"bruce barker" <no***********@safeco.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
the browser is caching the page itself, thus the server knows nothing about it.

-- bruce (sqlwork.com)

"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:OP**************@TK2MSFTNGP12.phx.gbl...
Just wondering what could cause this: I have observed that when first
opening an aspx page, the Page_Load event fires as expected. Then I go to other pages in the site. When returning to any page that has been

previously
viewed, the Page_Load event does not fire (or at least the Page_Load event procedure is not executed). FWIW: PostBacks are working fine (meaning that the Page_Load event procedure executes on PostBacks). The problem is just when I navigate away to another page and then return to a previously

viewed
page.

Please note that I do NOT have output Caching enabled on any of the pages. Also, while I have not tested every single page in my ASP.NET Web
application, I have observed this behavior in many of them (and none I

have
tested show the behavior I expect/need - which is to have Page_Load fire

on
every request for the page).

What can cause this? How can I make it so that the Page_Load event

procedure
executes on every request for the page?

Thanks!


Nov 18 '05 #3
You can do that by passing some of the header arguments..
http://www.htmlgoodies.com/beyond/nocache.html for ASP/HTML answers.

Or you can use Response.Cache object and call SetNoStore..

"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:ut*************@TK2MSFTNGP09.phx.gbl...
Is there any way I can tell the browser to NOT cache the page? Or is doing
that generally frowned upon?

-G
"bruce barker" <no***********@safeco.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
the browser is caching the page itself, thus the server knows nothing

about
it.

-- bruce (sqlwork.com)

"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:OP**************@TK2MSFTNGP12.phx.gbl...
Just wondering what could cause this: I have observed that when first
opening an aspx page, the Page_Load event fires as expected. Then I go to other pages in the site. When returning to any page that has been

previously
viewed, the Page_Load event does not fire (or at least the Page_Load event procedure is not executed). FWIW: PostBacks are working fine (meaning that the Page_Load event procedure executes on PostBacks). The problem is just when I navigate away to another page and then return to a previously

viewed
page.

Please note that I do NOT have output Caching enabled on any of the pages. Also, while I have not tested every single page in my ASP.NET Web
application, I have observed this behavior in many of them (and none I

have
tested show the behavior I expect/need - which is to have Page_Load
fire on
every request for the page).

What can cause this? How can I make it so that the Page_Load event

procedure
executes on every request for the page?

Thanks!



Nov 18 '05 #4
Or add:

<%@ OutputCache Location="none" %>

directive at top of the page

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke
"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:ut*************@TK2MSFTNGP09.phx.gbl...
Is there any way I can tell the browser to NOT cache the page? Or is doing
that generally frowned upon?

-G
"bruce barker" <no***********@safeco.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
the browser is caching the page itself, thus the server knows nothing

about
it.

-- bruce (sqlwork.com)

"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:OP**************@TK2MSFTNGP12.phx.gbl...
Just wondering what could cause this: I have observed that when first
opening an aspx page, the Page_Load event fires as expected. Then I go to other pages in the site. When returning to any page that has been

previously
viewed, the Page_Load event does not fire (or at least the Page_Load event procedure is not executed). FWIW: PostBacks are working fine (meaning that the Page_Load event procedure executes on PostBacks). The problem is just when I navigate away to another page and then return to a previously

viewed
page.

Please note that I do NOT have output Caching enabled on any of the pages. Also, while I have not tested every single page in my ASP.NET Web
application, I have observed this behavior in many of them (and none I

have
tested show the behavior I expect/need - which is to have Page_Load
fire on
every request for the page).

What can cause this? How can I make it so that the Page_Load event

procedure
executes on every request for the page?

Thanks!



Nov 18 '05 #5

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

Similar topics

2
by: Rohan Parkes | last post by:
I'm fairly new to ASP.NET, and am trying out the Online Newsletter Manager project in Wrox's Beginning C#. The pages are supposed to bind various controls (dropdown lists, datagrids) when the pages...
2
by: dx | last post by:
I have a simple user control (.ascx) that is dynamically instantiated in the calling aspx page and added to the control tree (within the page_load.) I have checked and the calling page only...
1
by: Gustavo De la Espriella | last post by:
Hi, I have an aspx page that should refresh a list containing items from a database. But it only refreshes the first time, after I navigate to other pages and then return to it, it doesn't call...
1
by: Raed Sawalha | last post by:
I am trying to sort a DataGrid in a user control that is programatically loaded when a link button is clicked. UC1 is loaded onto Page1.aspx after clicking a link button. No problem, loads fine....
1
by: Don Christine | last post by:
Hello, I'm just now learning how to deploy a simple, working ASP.NET application developed in VS.NET 2002 that runs fine on my workstation running IIS. When I copy the project files over to...
2
by: adolf garlic | last post by:
I'm having a problem with a button click event being fired erroneously. My login.aspx page has the usual username/password boxes. There is also a link to click when you have filled these, plus a...
6
by: dwclark | last post by:
I am having an issue when I trigger a Response.Redirect, the Page_Load fires on the page where the Response.Redirect was called. From what I've read, this should not happen and the browser should...
1
by: ryan.mclean | last post by:
Hello all, Here is my problem: I made a simple web project that uses they new webparts. On my page, I have a DeclarativeCatalogPart that contains references to several ascx files. I put my page...
0
by: Jason Wilson | last post by:
I have two pages that that cross post to each other: Page1 has a form Page2 verifies the form entries before posting to a DB If the user sees problems with their entries they can click an Edit...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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.