SharePoint Error – Code blocks are not allowed in this file

When I was adding an in-line code into master page I was getting the following error.

An error occurred during the processing of /sites/<collection>/SitePages/Welcome.master. Code blocks are not allowed in this file.

The fix is add the following code to the web.config of the web application which hosts the site collection.




Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.