感覺不錯,就轉過來了。
這種方式開發比較友善,不過有一個大問題就是失去了Sharepoint的特色,不能定制自己的portal了,還是開發webpart比較正規一點:)
第一點:将生成的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/firstyi/archive/2008/04/15/1154036.html,如需轉載請自行聯系原作者