My SharePoint Blog

Blogs On SharePoint Technologies


Search Site

Recent posts

Recent comments

Tags

Don't show

    Categories


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Running Code Blocks In Your SharePoint ASPX Pages.

    You may see this error:

    An error occurred during the processing of /test.aspx. Code blocks are not allowed in this file.

    Reason:  SharePoint does not allow server side code to execute in aspx pages contained in the SharePoint site.

    Fix:  Edit the web.config (I.E. C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config) file:

    <PageParserPaths>
            <!-- To allow a single file: -->
            <PageParserPath VirtualPath="/test.aspx" CompilationMode="Always" AllowServerSideScript="true" />
            <!-- To allow global: -->
            <PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" />
            <!-- To allow global within a subsite: -->
            <PageParserPath VirtualPath="/websitefoobar/*" CompilationMode="Always" AllowServerSideScript="true" />
    </PageParserPaths>

    Categories: SharePoint
    Posted by Kevin on Tuesday, January 29, 2008 12:04 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Add comment


     

    [b][/b] - [i][/i] - [u][/u]- [quote][/quote]



    Live preview

    Sunday, September 07, 2008 6:36 PM