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


Hello everyone,

Today I’ll talk about an error that often happens when developing custom page layouts.

If you have a page using a custom page layout and that when you browse this page you see the error “Only Content controls are allowed directly in a content page that contains Content controls.“, check your page layout.

There are great chances that the tag “<asp:Content></asp:Content>” became “<asp:content></asp:content> “.

This happens when you use the Visual Studio very useful shortcut to format your code(CTRL + K, D),  it replaces the “C” by a “c” in the tag “<asp:Content>“.

It’s easy to find when you know it but when you seek for the error’s reason, you don’t necessarily think about that …

Hope this help.

Christopher.