0

我有master page两个父级contentplaceholders,后来我被添加masterpage到现有的嵌套中master page
在那我想要在 body 部分 parent 中的两列masterpage contentplaceholder,为此我采用了两个 div 标签,在每个 div 标签内我采用了两个contentplaceholder.

但他们返回母版页错误说:

The page contains markup that is not valid when attached to a master page.

这是我的儿童母版页,我写错了吗

  <%@ Master Language="C#" MasterPageFile="~/Home.Master" AutoEventWireup="true" CodeBehind="Admin.master.cs" Inherits="OnlinePortalWebProject.Admin" %>
   <asp:Content ID="Content1" ContentPlaceHolderID="Parenthead" runat="server">
   </asp:Content>
   <asp:Content ID="Content2" ContentPlaceHolderID="ParnetBody" runat="server">
       <div class="Admin">
           <div class="AdminLeftPanel">
               <asp:content ID="LeftPanel"
                    ContentPlaceHolderID="ChildLeftPanelContnet" runat="server">
               </asp:content>
           </div>
           <div class="AdminRightPanel">
               <asp:content ID="Content3" 
                    ContentPlaceHolderID="ChildRightPanelContnet" runat="server">
               </asp:content>
           </div>
       </div>
   </asp:Content>
4

1 回答 1

2

您的问题出在 asp:content 上。据我所知,您不能直接在 asp:content 中使用 asp:content。但在这种情况下,您的页面应该是母版页。

<div class="Admin">
   <div class="AdminLeftPanel">
     <asp:ContentPlaceHolder ID="ChildLeftPanelContnet" runat="server">
     </asp:ContentPlaceHolder>
   </div>
   <div class="AdminRightPanel">
   <asp:ContentPlaceHolder ID="ChildRightPanelContnet" runat="server">
   </asp:ContentPlaceHolder>
   </div>
</div>
于 2013-09-25T12:42:10.953 回答