我有一个带有 name 的母版页MasterPage.master。
现在我想创建另一个母版页 ( MasterPage2.master),它MasterPageFile是MasterPage.master,但是当我创建MasterPage2然后创建一个 web 表单时MasterPage2,这个 web 表单中没有任何内容ContentPlaceHolder。
请为我解释...
我有一个带有 name 的母版页MasterPage.master。
现在我想创建另一个母版页 ( MasterPage2.master),它MasterPageFile是MasterPage.master,但是当我创建MasterPage2然后创建一个 web 表单时MasterPage2,这个 web 表单中没有任何内容ContentPlaceHolder。
请为我解释...
您正在寻找的是嵌套母版页。
谷歌它,你会得到大量的教程。来自谷歌的前 2 个结果:
http://msdn.microsoft.com/en-us/library/x2b3ktt7(v=vs.100).aspx
http://msdn.microsoft.com/en-us/library/bb547109(v=vs.100) .aspx
最有可能的是:
ContentPlaceHolder来自 MasterPage 但未添加另一个ContentPlaceHolder供您的内容页面使用ContentPlaceHolderMasterPage 上的 ID 相同确保 MasterPage2 具有ContentPlaceHolder唯一标识符。