Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I run masterpage pageload before child pageload (i want to access datamembers)

Posted on 2011-02-20
3
Medium Priority
?
593 Views
Last Modified: 2012-05-11
In our ASP.NET project, we have a master page which constructs certain objects in its Page_Load method.

We have another page that uses this Master page as its master page, which requires the objects constructed in the Page_Load method of the master page.

We have performed experiments which indicate that the Page_Load method of the child is being run before the Page_Load of the master page.

How would you recommend accessing those datamembers?

Note: Constructing the desired objects in the constructor of the master page is not an option, because we require data passed into Page_Load.
0
Comment
Question by:cjrbus
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 2000 total points
ID: 34939165
Master pages are actually controls from the point of view of the page lifecycle and consequently are loaded by the page during the page load event as with any other controls.

So loading stuff in the masterpage that is required by the page isn't really the correct way to do it.

That said if you really have no choice about the matter then create an event in your master page that you fire once the data is loaded, and register an event handler in the page which will receive this event notification and know that the data is loaded and available to be accessed.
0
 
LVL 1

Author Comment

by:cjrbus
ID: 34939282
Thank you we just used delegates... but this does answer my question
0
 
LVL 1

Author Closing Comment

by:cjrbus
ID: 34939284
thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Loops Section Overview
Screencast - Getting to Know the Pipeline

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question