When using web forms, the PreInit event page appears dynamically as the appropriate place to assign master pages to a page:
this.Master.MasterPageFile = "~/leaf.Master"
If nessasary, master pages can be set here in the hierarchy of nested master pages:
this.Master.MasterPageFile = "~/leaf.Master"
this.Master.Master.MasterPageFile = "~/root.Master"
Using the MVC framework, you can dynamically set one master page name using the Viewers Controls method by passing the name masterName, but how do you set other master pages above in the hierarchy?
Update
Sorry, I was not clean.
By hierarchy, I mean a chain of nested master pages, so how can I set the topmost main page in a chain of nested master pages?
For example, we have such a setting that different types of clients have different master pages and the ones embedded in this main page are an additional main page for certain user roles. We need to dynamically install the root client wizard, as well as the role wizard.
source
share