16 November, 2011

Code blocks are not allowed in this file

One of my user has opened a ticket with my team by mentioning “He is not able to browse his SharePoint Team Site and getting the below mentioned error message.

Problem Description: Not able to browse the SharePoint site

Error Message: An error occurred during the processing of /site/My Documents/Forms/Alldocuments.aspx. Code blocks are not allowed in this file.
Here is my analysis regarding the same:
    1) Check the site settings page is opening or not.
   How to check that? - Site URL/_layouts/settings.aspx
   2) If you are using any specialized master page in your environment then make sure it is properly selected under the master page galleries
How to check that? – Site actions-site settings-Under look and feel-master page galleries
   3) Check the default.aspx page is existing or not
How to check that?

-Open your site, it’s quite obvious that you will get error message
-Be on that same page
-Control + O (from your keyboard)
-This will open the shared view of your site
-if you see the default.aspx page their then go ahead and take the backup of that page in the same location
-It wills create-default1.aspx—this is fine and we are on right track
-In this same shared location, you can see the created subsites i.e. the child sites which are created underneath
-Go to any of the subsite by means of shared drive and copy the default.aspx and paste it at the root location
-Try t browse the site and check the results
-Your site is up and running without any issuesJ

If you have any queries/questions then please let me know.
I would be more than HAPPY to help you as well as RESOLVES your issues, Thank youJ


  1. Hello, I saw your post (http://sharepointknowledgebase.blogspot.com/2011/11/code-blocks-are-not-allowed-in-this.html) and was not able to follow your resolution. Can you help. I tried to do control O but it did not do anything. What am I doing wrong?

  2. Hello,

    -Open your sharepoint site on which you are working
    -Open the home page of the site
    -Make sure that the cursor is in the blank area of the site and not on any task bar
    -by means of your keyboard functions- CTRL O and it will give the option to enter the site URL as well as please check the box adjacent to it.
    -click ok
    -and it will open the shared view of the site


    if its not working for you then follow the below mentioned steps:

    -my network places
    -create a new network place
    -enter the site URL without default.aspx
    -click next
    -thats it, shared view will be open

    once it will open then follow the remaining steps by means of BLOG

    in case of any further queries then please let me know, Thank you

  3. Ok thanks. I got it to work by resetting the site definition in Site Settings. Thanks for replying.


Your feedback is always appreciated. I will try to reply to your queries as soon as possible- Amol Ghuge

Note: Only a member of this blog may post a comment.