asp.net - Content Web Form not permitting to add content -
this code of nested master page in project:
<%@ master language="c#" masterpagefile="~/presentation_layer/pages/home.master" autoeventwireup="true" codebehind="cmsnestedmasterpage.master.cs" inherits="livetest.presentation_layer.pages.cmsnestedmasterpage" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> </asp:content> <asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <div id="divmenusidebarleft" class="mainsidebar1div" style="top: 2px" title="livetest cms menu"> </div> <div id="divcmscontent" class="maincontentdiv" title="divcmscontent" style="background-color: buttonface; width: 791px; left: 203px; position:relative; top: -602px;"> </div> </asp:content>
i have following queries:
- the first
contentplaceholder
contentplaceholderid="head"
, for? bothcontentplaceholder
s automatically added when added nested master page project. - in second
contentplaceholder
contentplaceholderid="contentplaceholder1"
, added 2div
s. 1 display side-bar on left , other going show forms entry. problem when added new web content form , linked master page, has 1 pre-written line:
<%@ page title="" language="c#" masterpagefile="~/presentation_layer/pages/cmsnestedmasterpage.master" autoeventwireup="true" codebehind="bookentry.aspx.cs" inherits="livetest.presentation_layer.pages.cms.bookentry" %>
the code not showing contentplaceholder
s. if try add one, gives error:
the page has 1 or more
<asp:content>
controls not correspond<asp:contentplaceholder>
controls in master page.
how rectify error?
you need add contentplaceholders
nested masterpage
inside content
elements. eg
masterpage 1:
<asp:contentplaceholder id="contentplaceholder1" runat="server"> </asp:contentplaceholder>
nested masterpage:
<asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <div id="divmenusidebarleft" class="mainsidebar1div" style="top: 2px" title="livetest cms menu"> </div> <div id="divcmscontent" class="maincontentdiv" title="divcmscontent" style="background-color: buttonface; width: 791px; left: 203px; position:relative; top: -602px;"> <-- content on page goes inside contentplaceholder --> <asp:contentplaceholder id="cphcmsdiv" runat="server"> </asp:contentplaceholder> </div> </asp:content>
then add corresponding content
items page (they added automatically new pages):
<asp:content id="content3" contentplaceholderid="cphcmsdiv" runat="server"> </asp:content>
Comments
Post a Comment