How to solve “Code blocks are not allowed in this file” error?

Hi,

if you are getting “Code blocks are not allowed in this file” error while browsing a page in SharePoint then it is because SharePoint disables the server code in script block. This is to make sure that no one should just upload an aspx page with malicious server side code and execute it to kill the SharePoint server :):)

craft essays http://grhfad.cias.rit.edu/rx/diarstop-dosaggio-viagra/30/ antabuse purchase go site kamagra oral jelly price india liquid viagra from thailand compare tadalafil and sildenafil http://nursing.au.edu/cart.php?add=levitra-emma https://drtracygapin.com/erections/thuoc-viagra-gia/25/ follow site https://peacerivergardens.org/proof/jfk-rice-university-speech-transcript/25/ https://cpchawaii.edu/lptf/papers.php?rewriter=brainstorm-possible-essay-topics source site source url scientific research paper template word work and stress essay essay on terrorism causes effects and solutions cheap viagra online reviews good and bad habits essay go here click here essay examples vacation good qualities of research paper go site expository essay sample for kids https://homemods.org/usc/check-my-essay-for-plagiarism/46/ https://eventorum.puc.edu/usarx/viagra-cost-assistance/82/ click here help save the environment essay https://smartfin.org/science/lamictal-akathesia/12/ http://hyperbaricnurses.org/5693-viagra-high-bloodpressure/ https://ramapoforchildren.org/youth/popular-critical-thinking-writers-website-uk/47/ OK, got it….now tell me how to allow server code in a specific page?

Here you go, just add following PageParserPath nodes under PageParserPaths node.  Refer below for an example:

<PageParserPaths>
        <!-- Following page has code in script -->
        <PageParserPath VirtualPath="/pages/test.aspx" CompilationMode="Always" AllowServerSideScript="true" />
</PageParserPaths>

Share

1 thought on “How to solve “Code blocks are not allowed in this file” error?”

  1. I have read this solution on many blogs but it did not work for me. Am I determining the virtual path incorrectly? I have two site collections and this one should point to only one of them, but I keep getting the error!

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap