Wednesday, October 3, 2012

Code Blocks are not allowed in this file - Performance Point



After the customization of the master page in SharePoint 2010, we sometimes get the following error
"Code Blocks are not allowed in this file"

There are two solution for this
1. Add the Page Parser Path in web.config
<PageParserPaths>
       <PageParserPath VirtualPath="/BICenter/Pages/ppssample.aspx" CompilationMode="Always" AllowServerSideScript="true" />
     </PageParserPaths>

2. Modify the PerformancePoint site template by updating the /BICenter/Pages/ppssample.aspx

Replace the following
var siteCollection = "<%=SPHttpUtility.UrlPathEncode(siteCol.Value,false,true)%>";
var siteLocation = "<%=SPHttpUtility.UrlPathEncode(site.Value,false,true)%>";

with
var siteCollection = "/";
var siteLocation = "/BICenter/";

No comments:

Post a Comment