將你的Asp.NET應用程式嵌入到SharePoint 讀後感

來源:互聯網
上載者:User
感覺不錯,就轉過來了。
這種方式開發比較方便,不過有一個大問題就是失去了Sharepoint的特色,不能定製自己的portal了,還是開發webpart比較正規一點:)

以下轉自:http://hi.baidu.com/hunterzou/blog/item/ef002bb10f4fc75008230225.html

第一點:將產生的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是使用者控制項所在的文件庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.