I am wondering if you can set the MasterType VirtualPath dynamically in the codebehind? I have other code that dynamically changes the MasterPageFile using OnPreInit(), but it seems that the MasterType VirtualPath value has to be hard-coded into the .aspx.
What I would like to do is call a function from the master page, but since the master page is set dynamically, I can't hard-code the VirtualPath into the aspx because I'd be calling the function from the wrong master page if I do.
Anyone know if I can set the MasterType VirtualPath value dynamically in the OnPreInit()? Or can I dynamically cast "this.Master" before calling the function?