我``使我的web部件運行良好(我可以將其添加到頁面並使用它)。但是,如果我想將其移動到其他區域或修改該頁面上的任何其他Web部件,我會得到一個異常。可以添加我的自定義web部件,但無法修改任何webpart頁面
關於什麼可能是錯誤的任何想法?
也許它必須做一些事情,我的web部件有一個空區變量?但是webpart在頁面上顯示效果良好。下面的細節。
編輯:啊,不,我看到其他(原始的)web部件的Zone變量也是空的。無論如何,我不知道如何甚至digg和找出問題。
Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))
Exception Details: Microsoft.SharePoint.WebPartPages.WebPartPageUserException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))
Stack Trace:
[WebPartPageUserException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))]
Microsoft.SharePoint.WebPartPages.SPWebPartManager.SaveSomeChanges(SPLayoutProperties layoutProperties) +897
Microsoft.SharePoint.WebPartPages.WebPart.SaveSomeChanges(SPLayoutProperties layoutProperties) +52
Microsoft.SharePoint.WebPartPages.SPWebPartManager.WPSaveSomeChanges(SPLayoutProperties layoutProperties) +83
Microsoft.SharePoint.WebPartPages.SPWebPartManager.ApplyChangeList(String changeString) +865
Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnLoad(EventArgs e) +398
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
解決方案處於第一個鏈接。 我正在使用一個函數,我通過SPWeb對象作爲參數,並在它的末尾,我處置。註釋掉web.Dispose(),它工作。 – 2009-07-02 10:18:57
酷,而要記住的要點是SPContext.Current.Web不屬於你,所以永遠不要處置它。 – Kusek 2009-07-02 11:44:30