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.
Solution:
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.

This is absolutely correct -just had to figure this out on my own on SBS 2008:
* Error:
/Clients/Client Documents/Forms/AllItems.aspx Code blocks are not allowed in this file
/Clients/Client Documents/Forms/AllItems.aspx
* Create testsite in sharepoint
* Install Sharepoint Designer(free):
http://www.microsoft.com/en-us/download/details.aspx?id=21581
* In designer, open-up both sites to the file location, and copy/paste allitems.aspx from testsite to corrupt file location (make a copy w/different name of the corrupt file first just in case) into http://companyweb.