What is the location in web page to hook a different master page to it?
-
Page_PreInit handler
-
Page_Load handler
-
Page_Init handler
-
Page_Unload handler
A
Correct answer
Explanation
In ASP.NET, the master page must be set dynamically during or before the Page_PreInit event. Attempting to assign or modify the MasterPageFile property during Page_Init or Page_Load occurs too late in the page lifecycle and throws an InvalidOperationException.