Episerver nested master page from EPiServerUI.master

371 views Asked by At

I want to have my custom master page for all GuiPlugIn reports. As we know, by default GuiPlugIn referes to EPiServerUI.master page which is part of installation. I want to create a nested master page for my GuiPlugIn instead of default.

Please share your thoughts.

Thanks, Kris

1

There are 1 answers

0
Andreas On

I think the reason that you cannot change master page for a plugin is for visual consistency. You could try to change the master page through code like this (assuming your plug in is a user control:

protected override void OnInit(EventArgs e) 
{
this.Page.MasterPageFile = "~/NewMaster.master";
}

Maybe there is a better way to do what you want, if you provide more detail?

You can always access the Page object if you want to inject custom css or scripts to use with your plugin like this:

HtmlGenericControl js = new HtmlGenericControl("script");
js.Attributes["type"] = "text/javascript";
js.Attributes["src"] = "mylibrary.js";
this.Page.Header.Controls.Add(js);