SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Child Page_Load() before Master Page_Load()?

    Why does the *.aspx page for the content placeholder in my master page execute it's Page_Load() procedure prior to my Master page's Page_Load() procedure. Sensically it should be the other way around, no?

    I'm going to tiddle with the "New" procedure and see how that and the Page_Load() procedure between pages relates to eachother. But in the mean time, does anybody know why Microsoft decided to do this??

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Location
    England
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahhh mere mortal do you question the wisdom of the dot NET gods. Yours is to obey and live by they life cycle.

    Consider this your first warning, and your first born will be spared.




    Of course I agree with your point, but I would never question otherwise my head would hurt, and then some bright spark will ask why we have UserControl_RenderControl() and UserControl_Render(), and the horrible explanations start all over again. SirKilljoy lives in ignorance, and is happy.

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,625
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Because your master page is actually a glorified user control, not some sort of special page. Go read K Scott Allen's excellent intro to master pages for details.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see... So my page Loads and then the content placeholder control wrap is oloaded and the Masterpage's Page_load is then executed... Thanks. Now I can fix my problem.

    This board needs some kinda rep/thank you feature.

  5. #5
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    I was wondering about this myself after ordering my new ide and playing around with the trial to get used to new stuff. But it makes sense, since your loading and page which then goes "oh hey, there's a master i need to use..." rather than the other way around.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •