Error : Code blocks are not allowed in this file

Hi All

I also faced such error in one of SharePoint site when I add one .aspx page, which contains some inline script and code. But at last I found solution for this error. When you add inline script or code in you .aspx page, it works fine as long as the page remain uncustomized in ghosted state. But as soon as you modify any aspect of this page with the SharePoint designer, it turns into unghosted state, WSS then begin to use safe mode to process it. So you just need to add following line of code within the SharePoint section of the web.config file.

<SharePoint>
<SafeMode…>
<PageParserPaths>
<PageParserPath VirtualPath=”Your Page Path” IncludeSubFolder=”true” CompilationMode=”Always” AllowServerSideScript=”true” />
</PageParserPath>
</SafeMode>
</SharePoint>

This Error is very common when you are going add site pages within SharePoint site and make some modification in page with SharePoint Designer.

Hope it will work for you guys. It seems work fine for me.

No comments: