Content controls have to be top-level controls in a content page or a nested master page that references a master page

老子叫甜甜 提交于 2019-12-01 16:53:51

The HTML-code in your nested masterpage must be wrapped with an asp:content-tag with a contentplaceholderid from the "master" masterpage.

Just to demonstrate Erik's point:

Parent masterpage:

<asp:ContentPlaceHolder ID="head" runat="server" />

Child masterpage:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <asp:ContentPlaceHolder ID="head" runat="server" />
</asp:Content>

Page:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <!-- content -->
</asp:Content>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!