【发布时间】:2011-09-18 13:33:06
【问题描述】:
让我公开我的问题: 我有一个根站点、一个母版页和许多子站点。有些正在使用根站点母版页(通过继承),有些没有使用根站点母版页。
当我使用这样的功能事件接收器更新根站点 MP 时:
SPWeb w = ((SPSite)properties.Feature.Parent).OpenWeb();
Uri masterUri = new Uri(w.Url + "/_catalogs/masterpage/AdventureWorks.master");
//MasterPage used by publishing pages
w.CustomMasterUrl = masterUri.AbsolutePath;
w.AllowUnsafeUpdates = true;
w.Update();
...母版页是为根站点更新的,但不是为从根站点母版页继承的子站点更新的!当我转到子站点的站点母版页设置页面时,“从该站点的父级继承站点母版页”单选按钮已选中。
当我从“站点母版页设置”页面应用新的 MasterPage 时,我没有遇到这个问题。
有关信息:我在一个发布站点中的根站点以及“SharePoint Server Publishing Infrastructure”和“SharePoint Server Publishing”功能正在运行。
我错过了什么吗?
【问题讨论】:
标签: c# sharepoint-2010 master-pages