Can add my custom webpart but then cannot modify any webpart on page

2

I`v made my webpart that works well (I can add it to page and use it). However if i want to move it to different zone or modify ANY other webpart on that page i get an exception.

Any ideas on what could be wrong?

Maybe it has to do something with that my web part has a null Zone variable? However webpart displays well on page. Details below.

Edit: Ahh, no, I see that other (original ones) web parts have Zone variable also as null. Anyway i have no idea how to even digg and find out the problem.

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
sharepoint
moss
wss
asked on Stack Overflow Jul 2, 2009 by Janis Veinbergs • edited Jul 2, 2009 by Janis Veinbergs

2 Answers

2

Try if any of the below solution works

this or this or this

answered on Stack Overflow Jul 2, 2009 by Kusek • edited Nov 10, 2009 by Kusek
1

Here's some troubleshooting thoughts:

Check the SharePoint logs

As the exception doesn't help much, you could try checking the SharePoint logs and see if there are any other errors occurring at the same time that aren't reported to the UI. These might give some more detail.

Break debugger on any exceptions

If no luck, try disabling Just My Code in Tools / Options / Debugging. This will ensure your code breaks when errors occur outside of your web part. Then set Debug / Exceptions to check for all CLR exceptions so that any exceptions that occur in SharePoint will break at the error. Finally attach the Visual Studio debugger to w3wp.exe and access your page. Be aware that the debugger will break on any exception, even those that are not related to this problem. Hopefully this will give you a clue.

Comment code

If that doesn't help to narrow down the problem, I would start commenting out the web part code until the error no longer occurs. Then uncomment until you reach the precise line that causes the error. As the exception is in SaveChanges, it's something to do with persisting the web part properties. That's where I'd start commenting out first.

answered on Stack Overflow Jul 2, 2009 by Alex Angas

User contributions licensed under CC BY-SA 3.0