Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

Allowing Inline C# Code in MOSS2007 Master Pages

0.00/5 (No votes)
14 Jul 2010CPOL 12.6K  
Does not do anything amazing but does show you can use the SharePoint object model in your inline code. If you saved the master page now and opened the site in your browser you’d get an error about not being able to run code blocks. There’s an extra line you need to put into your web.config file first to allow this inline C# to execute.

<PageParserPaths> 
<PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" /> 
</PageParserPaths>

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)