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



I created a new custom page layout using Visual studio and created a new page based on the page layout. When I deploy my custom solution. Its deployed fine , As I create new page using my custom page layout, Page created successfullu but not able to browse the page amd my publishing page was throwing a error  " Only Content controls are allowed directly in a content page that contains Content controls". and showed some html elements in the error message which is placed outside of the content place holder.

I went back to my page layout design and after much analysis i could figure out the culprit. Its the case sensitive of contentplaceholder tag.
My code was like this which is actually fine and should work.

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

Redeployed the solution and it did the trick. It was working fine. So the lower case of the content place holder tag has actually inserted some html markups to my page which in turn has caused me the error.


No comments:

Post a Comment