I have parent master page
with two contentplaceholders
, later I am added nested masterpage
with existing master page
.
In that I want two columns in body section parent masterpage contentplaceholder
, for that I have taken two div tags, inside each of div tag I had taken two contentplaceholder
.
But they are returning master page error saying:
The page contains markup that is not valid when attached to a master page.
Here is my Child master page, is there any wrong I had written
<%@ 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>
Your problem is with the asp:content. As far i can say you cannot use asp:content directly inside asp:content. But In this case your page shoulb be Master Page.
<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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.