When does Page Load happen?

R

Ross

I have an aspx page containing two IFrames, each of which
contain aspx pages. The mother page has a dataset filled
with a single call to my Oracle database. This dataset has
three tables. The mother page uses data from table1; the
first child page uses data from table2 and table3; the
last child page uses table3 only.
So the mother page's Page_Load fills the dataset and binds
to some controls. The child pages will use their Page_Load
methods to call a method on the mother page (getDataSet)
to obtain the data they need from the mother dataset.
Question: Does the Page_Load on the mother page finish
before the Page_Load on the children begin? Otherwise, the
call to getDataSet may throw some funky errors.
 
A

AW

You have no guarantee at all on the order. In fact, it will depend on the
client's browser because it is the one that will issue the requests for the
two pages in the order that it wants.

In your case, I suggest that you use a call to the same method in the two
pages. The method will:
-load the data from the database and place it in the cache if it's not in
the cache, then return it
-return the data from the cache if it's already in.

That way you will have the same optimized effect without any dependence on
the order.
 
C

charles

Yes... the Mother page's page load finishes and serves everything to the
browser and then the browser figures out the that there are IFrames and
generates additional requests for those content pages.

However, I don't believe that GetDataSet will work because the requests for
the IFrame pages are entirely independent requests and the server doesn't
know they are related to the mother page. Instead, you'll have to stash the
dataset in a session variable or some other more global storage.

charles
 
K

Kevin Spencer

Question: Does the Page_Load on the mother page finish
before the Page_Load on the children begin? Otherwise, the
call to getDataSet may throw some funky errors.

These are asynchronous, unrelated HTTP requests, so there is no way to have
anything depend on when the Page_Load Sub of any of these pages will fire.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 

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

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top