I assume that you are really asking, what is the relationship between the page and its main page in terms of programming? I answer that relationships are not what most people would prefer . You might think that MasterPage contains a page because, looking at the html markup and ContentPlaceHolders, the html elements of the MasterPage end with the contents of the html elements on the page.
In fact, relationships are the other way around. The page belongs to the master page. The PreInit method on the page allows you to change the MasterPage.
The best way to describe what will happen next is for the Page to be wrapped in MasterPage . After the PreInit event of the content page, but before its Init event, the contents of the MasterPage are inserted in and around the asp: Content blocks in accordance with the position of the ContentPlaceHolders on the MasterPage.
Typically, event handlers on a page are executed up to those on MasterPage, which are processed as a control that has been introduced in and around the page.
You can see it in this > Tim Mount
Extract:
Page Start OnLoad(EventArgs e) Page Page_Load(object sender, EventArgs e) Page End OnLoad(EventArgs e) MasterPage Start OnLoad(EventArgs e) MasterPage Page_Load(object sender, EventArgs e) MasterPage End OnLoad(EventArgs e) UserControl Start OnLoad(EventArgs e) UserControl Page_Load(object sender, EventArgs e) UserControl End OnLoad(EventArgs e) CustomWebControl Start OnLoad(EventArgs e) CustomWebControl End OnLoad(EventArgs e)
source share