I want to set the masterpage dynamically, But currently I have a base page with Page_PreInit that initializes/performs varioustasks needed for memberpages.
Now I know you could override the base page by putting (new protected void Page_OnInit(..)) in the member page but I don’t want to as said the base page has got its job to do.
"this.MasterPageFile ="
Is there any way to set the masterpage after or before the Page_PreInit?
Or utilize both Page PreInt and BasePage PreInt ?
Thanks
EDIT: Rereading your question, I see your problem:
Original answer
http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx#sectionToggle1
According to MSDN, you can assign it during
Page_PreInit.Is there a reason to do it before or after
Page_PreInit? I’m not entirely sure anything useful comes before pre-init in the page life-cycle anyways.(source: microsoft.com)
There isn’t an earlier hook, except the page constructor, if you could do it there. But you wouldn’t have access to any of the page values yet.