Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Code blocks are not allowed in this file

$
0
0

Hello, we have been migrating our sharpoint server from 2007 to 2013. After upgrading to sharepoint 2010 and testing  our custom code (basicly we only have a custom page for searching and displaying certain info about documents and it uses custom queries for it) was working fine. But after upgrading from sharpoint 2010 to 2013, this is not working any more. The error is telling us that code blocks are not allowed in this file. We updated the web.config in the application folder, and still it doesnt workt. Eaven after we used the code below wich shuld allow code blocks in the entire webapp it still display the same message.

<PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" />

At first we thought there was an error in the code but there isnt becouse even empty code blocks dont work. There is 1 scenario where the page displays.

// the only time page displays is when there is no script tag
//or there is a script tag with no white space in it<script type="text/C#" runat="server"></script> //if I put any whitespace or newline the site cannot be
//displayed and throws the error mentioned above<script type="text/C#" runat="server"> //no code just whitespace</script>


We really dont know what to do next, I know that putting code in aspx file is a no no, but we have to upgrade sharepoint in a very short time, and the functioanality cannot change yet.

Is there something I missed else I really dont know what to do next.

Thank you in advance.
B


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>