尝试实现新内容页面的“duh”时刻
这是结构
Master Page ---- Nested Master Page -------- Nested Master's Content Page
标记:
主页
<asp:ContentPlaceHolder ID="bodyContent" runat="server"> </asp:ContentPlaceHolder>
嵌套主页
MasterPageFile="~/Views/Shared/Administrator.Master" <asp:Content ID="Content2" CotentPlaceHolderID="bodyContent" runat="server"> </asp:Content>
嵌套硕士内容页
MasterPageFile="~/Views/Intervention/InterventionMaster.master" <asp:Content runat="server" ID="myContent" ContentPlaceHolderID="Content2"> </asp:Content>
接收错误:
Cannot find ContentPlaceHolder ‘Content2’ in the master page
‘/Views/Intervention/InterventionMaster.master’,verify content
control’s ContentPlaceHolderID attribute in the content page.
我该怎么做错了?
解决方法
您没有ContentPlaceHolder ID =“Content2”。你只有这样的ID的内容。在ID =“Content2”的内容中放置另一个占位符,然后连接页面内容。
主页
<asp:ContentPlaceHolder ID="bodyContent" runat="server"> </asp:ContentPlaceHolder>
嵌套主页
<asp:Content ID="Content2" ContentPlaceHolderID="bodyContent" runat="server"> <asp:ContentPlaceHolder ID="nestedContent" runat="server"> </asp:ContentPlaceHolder> </asp:Content>
嵌套硕士内容页
<asp:Content runat="server" ID="myContent" ContentPlaceHolderID="nestedContent"> </asp:Content>