Allowing SharePoint to execute inline code in .aspx files

If you try to upload an aspx file with inline code in it, SharePoint will give you an error. To execute that inline code, the web.config file needs to be modified to allow execution of that particular aspx file as follows:

      <PageParserPaths>
        <PageParserPath VirtualPath="/path/to/script.aspx" CompilationMode="Always" AllowServerSideScript="true" />
      </PageParserPaths>

This should be placed between the <SafeMode> </SafeMode> tags which is within the <SharePoint> </SharePoint> tags.

Note that you can use the * character if you would like the entire library to be able to execute inline code.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.