Code blocks are not allowed in this file error in SharePoint 2010

2017-12-11T16:04:59+00:00 April 30th, 2012|Sharepoint|

We came across the below issue after a using uploaded some files to a SharePoint site. When navigating to the affected site users would receive the following error:

An error occurred during the processing of /site/SharedDocuments/Forms/AllItems.aspx. Code blocks are not allowed in this file.


The AllItems.aspx had become corrupt. To resolve this we replaced the Allitems.aspx file with one from a working site. To access the files, use the “Open with Explorer” option in SharePoint and navigate to the “Forms” folder.