Monday, May 31, 2010

Allow the code block in sharepoint

In the web.config file in the SharePoint virtual directory contains the following section:
  <SharePoint>
    <SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
      <PageParserPaths>
      </PageParserPaths>
    </SafeMode>
    :
  </SharePoint>

     

       
By default the node is empty. You can add nodes to specify the virtual paths where you want to allow server side scripts:
<PageParserPaths>
        <PageParserPath VirtualPath="/pages/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/>
</PageParserPaths>

       

Where CompilationMode is one of the following values:


       

Always The page should always be compiled (default value)
Auto ASP.NET will not compile the page, if possible. 
Never The page or control should never be dynamically compiled.

No comments:

Post a Comment