我需要帮助启用服务器端脚本,我已经参考了教程,但更改似乎没有生效。
处理/CMD/Pages/gjgc.aspx时出错。此文件中不允许使用代码块。
我知道解决方案是编辑web.config并为PageParser添加一行。问题是,当我进行更改时,我仍然会得到错误。
该页面位于http//xxx/CMD/Pages/route.aspx (端口80)
这是我要添加到web.config中的条目:
<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
<PageParserPaths>
<PageParserPath VirtualPath="~/CMD/Pages/route.aspx" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/>
</PageParserPaths> 我不明白为什么更改没有生效,或者是我对虚拟路径的使用不正确?任何帮助都是非常感谢的。
发布于 2012-10-23 18:30:30
要在文件夹上启用代码块,请执行如下通配符:
<PageParserPath VirtualPath="/CMD/Pages/*"
CompilationMode="Always" AllowServerSideScript="true"
IncludeSubFolders="true"/>否则,要在File上启用代码块:
<PageParserPath VirtualPath="/CMD/Pages/Test.aspx"
CompilationMode="Always" AllowServerSideScript="true" /> 注意两个变化: VirtualPath和IncludeSubFolders
请在每次web.config更改后重置。
https://stackoverflow.com/questions/12864480
复制相似问题