I need to dynamically set the MasterPageFile based on some user information to provide different branded access to pages on my website.
I am storing the MasterPageFile path in a Profile variable called MasterPageFile that is stored for anonymous user access. Then I am overriding the pages PreInit event as follows:
public void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = Context.Profile.GetPropertyValue("MasterPageFile").ToString();
}
This happens all over the site, so I want to move it into a superclass called "BrandedPage" and then have the pages on my site inherit from "Branded Page".
There are a couple of pages that don't use masters, so I don't want those pages to inherit from the custom superclass.
I can't find an "Inherits" property in the @Page directive. How do I set this up?