SharePoint 2013 排错之"Code blocks are not allowed in this file"
2014-04-25 07:37
731 查看
今天,设置页面布局的自定义母版页时,设置完了以后保存,然后预览报错,错误如下截图;删掉自定义母版页的MasterPageFile属性,页面依然报错;感觉甚是奇怪,因为有版本控制,还原为最初的版本,依然报错,我这暴脾气!一气之下,删掉了这个默认自带的母版页,从其他环境导过来一个,结果依然报错,错误如下图;
想来想去百思不得其解,然后看了看错误,发现是这个文件不允许后台代码,谷歌了一下(链接附后),发现设置web.config可以允许后台代码(配置文件截图如下),改过配置文件以后,确实页面不报错了,但是记得,千万别删掉自带的页面布局,我发现即使导过来一个一模一样的,效果也不一样,郁闷!最后还是从回收站还原最初的。
web.config修改节点,如下:
结束语
错误是修改好了,依旧不解为什么我的页面布局,就报错了?还需要开启后台代码,这个安全不安全?改回来为什么不行?说是页面布局的类型被改变了,自带的页面布局,真是很脆弱,大家修改的时候,注意备份,小心谨慎吧!前车之鉴啊!
参考链接
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d198c19a-701d-4032-aad4-ddf336adc17c/master-page-error-code-blocks-are-not-allowed-in-this-file?forum=sharepointcustomizationlegacy
想来想去百思不得其解,然后看了看错误,发现是这个文件不允许后台代码,谷歌了一下(链接附后),发现设置web.config可以允许后台代码(配置文件截图如下),改过配置文件以后,确实页面不报错了,但是记得,千万别删掉自带的页面布局,我发现即使导过来一个一模一样的,效果也不一样,郁闷!最后还是从回收站还原最初的。
web.config修改节点,如下:
<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="250" AllowPageLevelTrace="false"> <PageParserPaths> <PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" /> </PageParserPaths> </SafeMode>
结束语
错误是修改好了,依旧不解为什么我的页面布局,就报错了?还需要开启后台代码,这个安全不安全?改回来为什么不行?说是页面布局的类型被改变了,自带的页面布局,真是很脆弱,大家修改的时候,注意备份,小心谨慎吧!前车之鉴啊!
参考链接
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d198c19a-701d-4032-aad4-ddf336adc17c/master-page-error-code-blocks-are-not-allowed-in-this-file?forum=sharepointcustomizationlegacy
相关文章推荐
- SharePoint 2013 排错之"Code blocks are not allowed in this file"
- SharePoint 2013 排错之"Code blocks are not allowed in this file"
- 转:Code-blocks are not allowed in this file: Using Server-Side Code with SharePoint
- SharePoint2007报出“Code Block are not allowed in this file ”的错误的解决方法
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
- SharePoint中异步调用邮件发送Asynchronous operations are not allowed in this context. Page starting an asynchronous operation
- SharePoint 2013 删除母版页报错“This file may not be moved, deleted, renamed, or otherwise edited”
- Code::Blocks 12.11 error: ‘nullptr’ was not declared in this scope&GNU GCC -std=gnu++0x
- BEA-290074 <Deployment service servlet received file download request for file "security/SerializedSystemIni.dat". The file may exist, but download of this file is not allowed.>
- git 报错 You are not allowed to push code to this project 的解决办法
- you are not allowed to push code to protected branches on this project
- SharePoint 2013 搜索报错"Unable to retrieve topology component health. This may be because the admin component is not up and running"
- Ubuntu——"xxx is not in the sudoers file.This incident will be reported" 错误解决方法
- remote: GitLab: You are not allowed to push code to protected branches on this project.
- Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not
- Code Recyclebin Contact me QQ:149906878 Write operations are not allowed in read-only mode (FlushMo
- Code::Blocks 12.11 error: ‘nullptr’ was not declared in this scope&GNU GCC -std=gnu++0x
- 解决 Code::Blocks之It seems that this file has not been built yet.
- codeblocks gcc error: 'for' loop initial declarations are only allowed in C99 mode|
- Linux 'XXXXXX' "is not in the sudoers file. This incident will be reported" 解决方法