SharePoint

SharePoint – Only Content controls are allowed directly in a content page that contains Content controls

1 Mins read
  • 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 2016 for a customer today. I checked some custom page layout using Visual studio 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“.

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

Solution


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”>). 

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

as well as asp:contentplaceholderId should be uppercase like this

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


I just changed the ‘c’ in the contentplaceholder

Note

if you are deploying the solution and still have the same issue, the layout might be locked by the SP designer, open the layout using SP designer and modify the same changes

Thanks


Related posts
IOSSharePoint

SharePoint MP4 not working on IOS

2 Mins read
I had an issue previously where uploaded .mp4 video in SharePoint will not playing on iPhone and iPad
SecurityWindows

The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID

2 Mins read
After upgrading to Windows 10. I keep getting the following two errors DistributedCOM
Technology

Windows 10 CRASH ERROR 0xc0000098

5 Mins read
Get the fix to the 0xc0000098: The Windows Boot Configuration Data file does not contain a valid OS entry boot error message affecting Windows Vista,…

Leave a Reply

Your email address will not be published. Required fields are marked *

×
SharePoint

CKSDev for Visual Studio 2015-2019