Tuesday, October 7, 2008

Code blocks are not allowed in this file

Whenever I start a new SharePoint project and put server side code in the master page I get this error. The fix to this is quite easy, all you need to do is locate the <pageparserpaths> </pageparserpaths> tags and put the following inbetween:

 <pageparserpath virtualpath="/_catalogs/masterpage/MyMasterPage.Master" compilationmode="Always" allowserversidescript="true">

No comments: