Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my custom master page html I created a div for the content like this:

<div class="container"> 
<div data-name="ContentPlaceHolderMain"><div class="DefaultContentBlog"></div></div>
</div>

But ContentPlaceHolderMain doesn't work. The content always appears at the bottom of my custom master page. How can I solve this?

my custom masterpage :

  <%-- SPG:

This HTML file has been associated with a SharePoint Master Page (.master file) carrying the same name.  While the files remain associated, you will not be allowed to edit the .master file, and any rename, move, or deletion operations will be reciprocated.

To build the master page directly from this HTML file, simply edit the page as you normally would.  Use the Snippet Generator at http://ahsps01/_layouts/15/ComponentHome.aspx?Url=http%3A%2F%2Fahsps01%2F%5Fcatalogs%2Fmasterpage%2Fbt%2Fbt%2Emaster to create and customize useful SharePoint entities, then copy and paste them as HTML snippets into your HTML code.   All updates to this file will automatically sync to the associated Master Page.

 --%>
<%@Master language="C#"%>
<%@Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@Register TagPrefix="wssucw" TagName="Welcome" Src="~/_controltemplates/15/Welcome.ascx"%>
<%@Register TagPrefix="wssucmui" TagName="MUISelector" Src="~/_controltemplates/15/MUISelector.ascx"%>
<%@Register TagPrefix="PublishingRibbon" TagName="PublishingRibbon" Src="~/_controltemplates/15/Ribbon.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<SharePoint:SPHtmlTag lang="en" runat="server" id="SPHtmlTag" dir="&lt;%$Resources:wss,multipages_direction_dir_value%&gt;">
<head runat="server">
        <meta http-equiv="X-UA-Compatible" content="IE=10" />

<meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Content-type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><SharePoint:RobotsMetaTag runat="server" /><SharePoint:PageTitle runat="server"><asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"><SharePoint:ProjectProperty Property="Title" runat="server" /></asp:ContentPlaceHolder></SharePoint:PageTitle><SharePoint:StartScript runat="server" /><SharePoint:CssLink runat="server" Version="15" /><SharePoint:CacheManifestLink runat="server" /><SharePoint:PageRenderMode runat="server" RenderModeType="Standard" /><SharePoint:ScriptLink language="javascript" name="core.js" OnDemand="true" runat="server" Localizable="false" /><SharePoint:ScriptLink language="javascript" name="menu.js" OnDemand="true" runat="server" Localizable="false" /><SharePoint:ScriptLink language="javascript" name="callout.js" OnDemand="true" runat="server" Localizable="false" /><SharePoint:ScriptLink language="javascript" name="sharing.js" OnDemand="true" runat="server" Localizable="false" /><SharePoint:ScriptLink language="javascript" name="suitelinks.js" OnDemand="true" runat="server" Localizable="false" /><SharePoint:CustomJSUrl runat="server" /><SharePoint:SoapDiscoveryLink runat="server" /><SharePoint:AjaxDelta id="DeltaPlaceHolderAdditionalPageHead" Container="false" runat="server"><asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" /><SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true" /><asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server" /></SharePoint:AjaxDelta><SharePoint:CssRegistration Name="Themable/corev15.css" runat="server" /><SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server"><WebPartPages:SPWebPartManager runat="server"/></SharePoint:AjaxDelta>

<meta charset="UTF-8" />

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="shortcut icon" href="/_catalogs/masterpage/bt/assets/img/favicon.png" />
<SharePoint:CssRegistration name="&lt;% $SPUrl:~sitecollection/_catalogs/masterpage/bt/assets/css/bootstrap.css %&gt;" runat="server" after="SharepointCssFile"/>
<SharePoint:CssRegistration name="&lt;% $SPUrl:~sitecollection/_catalogs/masterpage/bt/assets/css/bootstrap-theme.css %&gt;" runat="server" after="SharepointCssFile"/>


</head>
<body onhashchange="if (typeof(_spBodyOnHashChange) != 'undefined') _spBodyOnHashChange();">
<SharePoint:SPClientIDGenerator runat="server" ServerControlID="DeltaPlaceHolderMain;DeltaPlaceHolderPageTitleInTitleArea;DeltaPlaceHolderUtilityContent"/>
<SharePoint:ImageLink runat="server"/><SharePoint:SharePointForm onsubmit="if (typeof(_spFormOnSubmitWrapper) != 'undefined') {return _spFormOnSubmitWrapper();} else {return true;}" runat="server" __designer:Preview="&lt;table cellpadding=4 cellspacing=0 style=&quot;font:messagebox;color:buttontext;background-color:buttonface;border: solid 1px;border-top-color:buttonhighlight;border-left-color:buttonhighlight;border-bottom-color:buttonshadow;border-right-color:buttonshadow&quot;&gt;
              &lt;tr&gt;&lt;td nowrap&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;SharePointForm&lt;/span&gt; - Unnamed5&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
            &lt;/table&gt;" __designer:Values="&lt;P N=&#39;Method&#39; T=&#39;post&#39; /&gt;&lt;P N=&#39;Name&#39; ID=&#39;1&#39; T=&#39;aspnetForm&#39; /&gt;&lt;P N=&#39;TagName&#39; T=&#39;form&#39; /&gt;&lt;P N=&#39;ID&#39; T=&#39;ctl04&#39; /&gt;&lt;P N=&#39;Page&#39; ID=&#39;2&#39; /&gt;&lt;P N=&#39;TemplateControl&#39; ID=&#39;3&#39; /&gt;&lt;P N=&#39;AppRelativeTemplateSourceDirectory&#39; R=&#39;-1&#39; /&gt;"><asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />

<SharePoint:SPSecurityTrimmedControl runat="server" HideFromSearchCrawler="true" EmitDiv="true"><div id="TurnOnAccessibility" style="display:none" class="s4-notdlg noindex"><a id="linkTurnOnAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();document.getElementById('linkTurnOffAcc').focus();return false;"><SharePoint:EncodedLiteral runat="server" text="&lt;%$Resources:wss,master_turnonaccessibility%&gt;" EncodeMethod="HtmlEncode" /></a></div><div id="TurnOffAccessibility" style="display:none" class="s4-notdlg noindex"><a id="linkTurnOffAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();document.getElementById('linkTurnOnAcc').focus();return false;"><SharePoint:EncodedLiteral runat="server" text="&lt;%$Resources:wss,master_turnoffaccessibility%&gt;" EncodeMethod="HtmlEncode" /></a></div></SharePoint:SPSecurityTrimmedControl><div id="ms-designer-ribbon"><PublishingRibbon:PublishingRibbon runat="server" /></div><SharePoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AnonymousUsersOnly"><wssucw:Welcome runat="server" EnableViewState="false" /></SharePoint:SPSecurityTrimmedControl>
<div id="s4-workspace"><div id="s4-bodyContainer">
<div class="navbar navbar-bt  navbar-static-top" role="navigation">
  <div class="container">
    <div class="navbar-header"> <a class="" href="#"> MY WEBSITE </a>
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Menü</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
    </div>
    <div class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right login">
        <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Ergün ERKAN <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="#">Logout</a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
</div>
<div class="container">
  <div class="row">
    <div class="col-lg-9 ">
       <a href=""> <img src="/_catalogs/masterpage/bt/assets/img/logo.png" height="86" width="399" alt="" /> </a>
    </div>
    <div class="col-lg-3 no-padding bt-right">
      <input type="text" class="form-text col-md-8" placeholder="Arama ..." />
      <input type="submit" class="form-submit col-md-3" value=" " />
    </div>
  </div>
</div>
<div class="container">
  <div class="row">
    <ul class="nav nav-pills bt-nav-mar">
      <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> SERVICES <span class="caret"></span> </a>
        <ul class="dropdown-menu">
          <li><a href="#">SERVICE 1</a></li>
          <li><a href="#">SERVICE 2</a></li>
        </ul>
      </li>
      <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> SUPPORT <span class="caret"></span> </a>
        <ul class="dropdown-menu">
          <li><a href="#">list 1</a></li>
          <li><a href="#">list 2</a></li>
        </ul>
      </li>
      <li><a href="#">SECURITY</a></li>
      <li><a href="#">ABOUT</a></li>
    </ul>
  </div>


</div>
<div class="container"> 
<asp:ContentPlaceHolder runat="server" id="ContentPlaceHolderMain"></asp:ContentPlaceHolder>
</div>

<div class="container">
    <div class="row">

    <div class="col-md-3 ">
        <div class="bt-top" style="padding: 10px">
            <h3>Adres</h3>
          <span class="adress">
          Flower Street, <br />
          No:20, 34365 <br />
          aaaaaaaa   
        </span>
        </div>
    </div>

        <div class="col-md-3 ">
        <div class="bt-top" style="padding: 10px">
        <h3>About</h3>
          <a href="">aaaaa</a>
          <div class="clearfix"></div>
          <a href="">aaaaa</a>
          <div class="clearfix"></div>
          <a href="">aaaaa</a>
          <div class="clearfix"></div>
          <a href="">aaaaa</a>
      </div>
    </div>

       <div class="col-md-3 ">
        <div class="bt-top" style="padding: 10px">
        <h3>Alerts</h3>
          <a href="">Alerts</a>
          <div class="clearfix"></div>
          <a href="">Contact</a>
          <div class="clearfix"></div>
          <a href="">Control Panel</a>
          <div class="clearfix"></div>
      </div>
    </div>

       <div class="col-md-3 ">
        <div class="bt-top" style="padding: 10px">
        <h3>Other</h3>
          <a href="">Web Mail</a>
          <div class="clearfix"></div>
      </div>
    </div>


    </div>
</div>

<div class="container-fluid footer-bt">
  <div class="container">
        <div class="leftt pull-left">© Address  </div>

        <div class="rightt pull-right">

            <a href="">About</a>
            <a href="">Map</a>
            <a href="">Search</a>
            <a href="">Copyright</a>
            <a href="">Human Resources</a>

        </div>

  </div>
</div>



<!-- HTML5 shim, for IE6-8 support of HTML5 elements --> 
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js">//<![CDATA[//]]></script>
      <![endif]--> 

<!-- Jquery dosyası --> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">//<![CDATA[//]]></script> 
<!-- Bootstrap js dosyası --> 
<script src="/_catalogs/masterpage/bt/assets/js/bootstrap.min.js">//<![CDATA[//]]></script> 
<script src="/_catalogs/masterpage/bt/assets/js/respond.min.js">//<![CDATA[//]]></script> 
<script src="/_catalogs/masterpage/bt/assets/js/html5shiv.js">//<![CDATA[//]]></script> 
<script type="text/javascript">//<![CDATA[
      $('.carousel').carousel({
        interval: 2000
      })
      //]]></script>


<div data-name="ContentPlaceHolderMain"><SharePoint:AjaxDelta ID="DeltaPlaceHolderMain" IsMainContent="true" runat="server"><asp:ContentPlaceHolder ID="PlaceHolderMain" runat="server"><div class="DefaultContentBlock" style="border:medium black solid; background:yellow; color:black; margin:20px; padding:10px;">
            This div, which you should delete, represents the content area that your Page Layouts and pages will fill. Design your Master Page around this content placeholder.
        </div></asp:ContentPlaceHolder></SharePoint:AjaxDelta>
</div></div></div><SharePoint:AjaxDelta id="DeltaFormDigest" BlockElement="true" runat="server"><asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server"><SharePoint:formdigest runat="server" /></asp:ContentPlaceHolder></SharePoint:AjaxDelta></SharePoint:SharePointForm><SharePoint:AjaxDelta id="DeltaPlaceHolderUtilityContent" runat="server"><asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server" /></SharePoint:AjaxDelta><asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderSearchArea" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderTopNavBar" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderLeftNavBarDataSource" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderLeftActions" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderLeftNavBarTop" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderSiteName" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderPageDescription" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderPageImage" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderMiniConsole" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderNavSpacer" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderLeftNavBarBorder" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" Visible="False" runat="server" /><asp:ContentPlaceHolder id="WSSDesignConsole" Visible="False" runat="server" /><asp:ContentPlaceHolder id="SPNavigation" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderQuickLaunchTop" Visible="False" runat="server" /><asp:ContentPlaceHolder id="PlaceHolderQuickLaunchBottom" Visible="False" runat="server" /></body>
</SharePoint:SPHtmlTag>
share|improve this question

1 Answer 1

You should use an ASP:ContentPlaceHolder control, not a div:

Something like

 <asp:ContentPlaceHolder runat="server" id="ContentPlaceHolderMain"></asp:ContentPlaceHolder>

(I'm on my phone so the syntax might not be 100%...)

share|improve this answer
    
Are you sure? Isn't the div the syntax for the 2013 branding stuff –  eirikb Apr 3 at 16:09
    
You would think Design manager would be mentioned somewhere in the post if so, but you might be right ;) –  Robert Lindgren Apr 3 at 16:16
    
Good point. I guess we just have to wait for OP to deliver –  eirikb Apr 3 at 20:06
    
Sorry for the late answer. It didn't work. When I press F12, I see that it creates this at the end of my masterpage code: <div data-name="ContentPlaceHolderMain"><span id="DeltaPlaceHolderMain">..</></> . Maybe it isn't fired? I add head of the custom master page. Can you check it? Thanks. –  e.ozmen Apr 4 at 5:31
    
It needs to be in the body –  Robert Lindgren Apr 4 at 5:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.