In Moss 2007 or SharePoint 2010, most of the times we need to create the custom master pages. In order to perform certain actions/functions, we need to insert code within those master pages.
Main problem comes into arena, when we try to use upload that master page into the master page gallery or copying into the file system, and use as system master page or site master page. Since the custom master page contains code with in it, so we used to get the below screen.
In order to solve this problem, we need to make entries into the corresponding web.config file by following the below steps.
1) Go to corresponding web.config file location which is located at the below location ( under c drive)
2) Open the web.config file , and under the <SafeMode><PageParserPaths> tag make the below entries.
< PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/>
VirtualPath attribute should contains location where the master page is located. "/*" at the end of the /_catalogs/masterpage" in the virtual path attribute indicates to also include the subfolders.
Main problem comes into arena, when we try to use upload that master page into the master page gallery or copying into the file system, and use as system master page or site master page. Since the custom master page contains code with in it, so we used to get the below screen.
In order to solve this problem, we need to make entries into the corresponding web.config file by following the below steps.
1) Go to corresponding web.config file location which is located at the below location ( under c drive)
2) Open the web.config file , and under the <SafeMode><PageParserPaths> tag make the below entries.
< PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/>
VirtualPath attribute should contains location where the master page is located. "/*" at the end of the /_catalogs/masterpage" in the virtual path attribute indicates to also include the subfolders.