Code block not allowed in your SharePoint Master Page error

"Code blocks are not allowed in this file"

Code blocks are not allowed in this file

I’m posting this now because I just ran into it for a second time, but had completely forgotten what the issue was when I googled it the first time.  So I’m posting it here for my convenience, mostly!

If you suddenly start getting an exception from SharePoint stating that code blocks aren’t allowed in your master page, you need to add a new <PageParserPath> element to web.config to allow the code.  Why this starts happening all of a sudden when the same code block existed in the path previously without the exception, I will never understand.  But the point is, follow the directions in one of these blog postings to resolve it:

http://mystepstones.wordpress.com/2009/02/13/code-blocks-are-not-allowed-in-this-file/

http://svengillis.blogspot.com/2008/03/code-block-are-not-allowed-in-this-file.html

http://dotnetdeveloper.co.uk/blogs/sharepoint/archive/2008/10/10/code-blocks-are-not-allowed-in-this-file.aspx

Advertisements

2 Responses to “Code block not allowed in your SharePoint Master Page error”


  1. 1 orthodontist reviews July 18, 2013 at 11:21 am

    What is the full name of the individual who wrote this article?
    How can we get more articles on-line from this author?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Scott’s recent tweets…


%d bloggers like this: