internal static void ApplyMasterPageRecursive (MasterPage master, List <string> appliedMasterPageFiles)
{
/* XXX need to use virtual paths here? */
if (master.MasterPageFile != null) {
if (appliedMasterPageFiles.Contains (master.MasterPageFile))
throw new HttpException ("circular dependency in master page files detected");
if (master.Master != null) {
master.Controls.Clear ();
master.Controls.Add (master.Master);
appliedMasterPageFiles.Add (master.MasterPageFile);
MasterPage.ApplyMasterPageRecursive (master.Master, appliedMasterPageFiles);
}
}
}
}