I m using master page in my project. I want to know the order in which the page loads of both master page and web page executes also about the scripts
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
- Master page child controls initialization: All server controls contained within the master page are first initialized.
- Content page child controls initialization: All server controls contained in the content page are initialized.
- Master page initialization: The master page itself is initialized.
- Content page initialization: The content page is initialized.
- Content page load: The content page is loaded (this is the Page_Load event followed by the Page_LoadComplete event).
- Master page load: The master page is loaded (this is also the Page_Load event).
- Master page child controls load: The server controls on the master page are loaded onto the page.
- Content page child controls load: The server controls on the content page are loaded onto the page.
http://it.toolbox.com/blogs/coding-dotnet/events-in-master-page-content-pages-16262
Method 2
From: https://msdn.microsoft.com/en-us/library/dct97kc3.aspx
The following is the sequence in which events occur when a master page is merged with a content page:
- Content page PreInit event.
- Master page controls Init event.
- Content controls Init event.
- Master page Init event.
- Content page Init event.
- Content page Load event.
- Master page Load event.
- Master page controls Load event.
- Content page controls Load event.
- Content page PreRender event.
- Master page PreRender event.
- Master page controls PreRender event.
- Content page controls PreRender event.
- Master page controls Unload event.
- Content page controls Unload event.
- Master page Unload event.
- Content page Unload event.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0