将你的Asp.NET应用程序嵌入到SharePoint 读后感

第一点:将生成的dll拷贝到网站目录下bin文件夹

第二点:在网站web.config文件的<SafeControls></SafeControls>节点中添加以下(目的是把应用程序注册为安全类型)
<SafeControl Assembly="WebInMOSS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace="WebInMOSS" TypeName="*" Safe="True" />
说明:其中WebInMOSS为应用程序的命名空间

第三点:删除页面的AutoEventWireup="true"属性

第四点:Web.config 文件的<SharePoint>节点,在 <PageParserPaths> </PageParserPaths>
节点下增加一个虚拟路径 <PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />
声明此站点下所有文件允许服务器端事件,当然你也可以制定虚拟目录是那个文件夹,但是这个值 必须以 ~/ 或 / 开头,并且必须以文件名或 * 结尾。
(目的为允许服务器端事件的运行)

第五点:把web.config文件的enableSessionState属性设为true(如果此应用程序要使用到Session的话)
<pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false"

pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,

PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">

第六点:在网站web.config文件的<SafeControls></SafeControls>节点中添加以下(目的是允许应用程序使用用户控件)
<SafeControl Src="~/Pages/*" IncludeSubFolders="True" Safe="True" AllowRemoteDesigner="True" />
说明:其中Pages是用户控件所在的文档库

原文地址:
http://www.cnblogs.com/Clank/archive/2007/05/21/754073.html
http://www.cnblogs.com/Clank/archive/2007/06/07/762576.html

posted on 2007-11-23 16:21  Endian/骆建峰  阅读(705)  评论(0编辑  收藏  举报