我已经将SharePoint 2010 web应用程序迁移到SharePoint 2013,并在兼容模式下运行。我有一个SharePoint设计师修改的母版页,这是保存在内容数据库。我在母版页中运行了一些内联代码。母版页在SharePoint 2010中运行良好。我在页面解析器中添加了这一行
<PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />但是在2013年,我仍然有相同的代码行,但是它仍然给我这个错误
处理/_catalogs/masterpage/custom.master时出错。此文件中不允许使用代码块。
当我将页面解析器中的条目更改为以下内容时,它可以正常工作
<PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />这不是一个好方法,因为它会打开我所有的页面以允许编写脚本。
你知道2013年的变化是什么吗? 2013年实现这一目标的最佳方式是什么
发布于 2013-12-08 03:04:33
下面是我的代码:
<PageParserPath VirtualPath="~/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />它在我这一端运行得很好。
发布于 2013-12-05 19:27:34
我在2013年通过将虚拟路径设置为"~/_catalogs/masterpage/*“使其正常工作。
发布于 2014-09-19 09:22:22
您是在SharePoint 2010中修改了母版页,还是仅在2013年修改了母版页?
此页面:http://blog.bullseyeconsulting.com/archive/2013/03/21/fixing-code-blocks-not-allowed.aspx
引用:
一旦“定制”(以前称为“未托管”),对该站点的母版页的引用就在数据库中,而不是在文件系统中。如果不对web.config进行更改,则不允许使用代码块,并且分页符。
https://stackoverflow.com/questions/20075514
复制相似问题