I have a Master page and a webpage that uses the Master page.
In both I have a Page_Load
event handler.
In which order are the Page_Load
handlers called? Content first then Master or Master first then content?
I have a Master page and a webpage that uses the Master page.
In both I have a Page_Load
event handler.
In which order are the Page_Load
handlers called? Content first then Master or Master first then content?
The content page load event will fire before the master page load event.
See here for full order (MSDN: Events in ASP.NET Master and Content Pages)
Copying incase link goes dead:
The following is the sequence in which events occur when a master page is merged with a content page:
As far as MasterPage is indeed a user control all rules applied to it as for user controls:
Master pages run Page_Load() from the deepest level of nesting outwards. So your nested webpage will first run the page_load event.
© 2022 - 2024 — McMap. All rights reserved.