我们可以在子母版页的contentplaceholder中放置div标签

时间:2013-09-25 12:32:06

标签: asp.net css html master-pages

我有两个master page的父contentplaceholders,后来我添加了嵌套masterpage与现有master page
在那里,我想在正文部分父masterpage contentplaceholder中有两列,因为我已经采用了两个div标签,在每个div标签中我已经采用了两个contentplaceholder

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

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

这是我的Child母版页,我写的是否有任何错误

  <%@ 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>

1 个答案:

答案 0 :(得分: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>