您的位置:首页 > 编程语言 > ASP

code block error. 在sharepoint aspx 页面中写自定义代码

2007-11-26 21:24 387 查看
我们在对aspx页面中加入代码的时候,通常会报错:code block 。

这个问题的解决方案:
1. 在 C:/Inetpub/wwwroot/wss/VirtualDirectories 下面找到你的站点
2. 进入站点的文件夹,找到webconfig
3. 打开webconfig 找到节点
<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
<PageParserPaths>

4. 加入<PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" /> 红色字体为你要写代码的虚拟路径,改为你需要的更改的虚拟路径即可。

5. 改了配置文件后,你就可以在sharepoint的aspx页面中加入
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
</script>
这样的代码了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐