Asp.net 2.0 WebPart使用經驗點滴

來源:互聯網
上載者:User
這幾天學習使用WebPart,發現眾多問題,使用點滴記錄如下,同各位共用:
1、WebPart的使用必須基於一個通過身分識別驗證的使用者會話。
2、WebPart的使用的個人化應用於所有人的選項預設是禁用的,可以通過修改Web.config來完成
<webParts>
   <personalization>
          <authorization>
             <allow users="*" verbs="enterSharedScope" />
          </authorization>
      </personalization>
    </webParts>
3、WebPart 預設使用頁面的 URL 儲存個人化資料.但是不包含 querystrings,現在要實現在通用的頁面(模版)來實現簡單的門戶系統,通過不同的querystrings來讀取個人,部門等的資料。這樣個人自己設定的設定可以直接和別人共用。這樣的需求在現有的WebPart系統上無法實現,在WebPart Components for Asp.net 2.0: Workspace home URL:http://www.gotdotnet.com/workspaces/workspace.aspx?id=65fa26c3-a62a-49d6-895d-422272e53a0c 有一個這樣的WebPart系統可以滿足需求。這個WebPart的作者介紹:http://fredrik.nsquared2.com/viewpost.aspx?PostID=326

 4、啟用WebPart得匯出功能:修改web.config中WebPart的設定
  <webParts enableExport="true">

5、匯入自訂的webPart 出現錯誤:Cannot add a control of Type DotnetClubPortal.WebControls.WebParts.RSSReader. The Type must be loadable by BuildManager.GetType(string typeName).
處理辦法:修改web.config檔案:
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="Bin" />
    </assemblyBinding>
 </runtime>
http://msdn2.microsoft.com/en-us/library/e0s9t4ck(en-US,VS.80).aspx

1、啟用匿名驗證即可。
<anonymousIdentification enabled="true"/>
3、NSQUARED² 的blog的確不錯,對於Webpart的文章很多。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.