Ads Top

SharePoint 2013 Page layout error: Only Content controls are allowed directly in a content page that contains Content controls

I was working on SharePoint migration from 2010 to 2013 for a customer today. I checked some custom page layout using Visual studio 2013 and created a new page based on the page layout. Suddenly the publishing page throwing this error" Only Content controls are allowed directly in a content page that contains Content controls".

I double checked the page layout. There was no html elements inside it. Everything is placed under the ContentPlaceHolder.

The cause is improper case for the <asp:Content> control tags in my page layout.  A few contorls used a lowercase "c" instead of an uppercase "C" in the word content.  The page layout that had trouble had tags that looked like: <asp:content> instead of <asp:Content>

The specific offending tag is the one associated with the page title (<asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">). 

as well as asp:contentplaceholderId should be uppercase like this

<asp:contentplaceholderId="PlaceHolderPageTitle" runat="server"></asp:content

I changed the 'c' in the contentplaceholder tag to upper case like this

<asp:ContentPlaceholderID="PlaceHolderPageTitle" runat="server"></asp:Content

if deploying the solution has no result, open the layout using SP designer and modify the changes




Powered by Blogger.