Monday, 4 June 2012

Attempted to use an object that has ceased to exist

I received this error when trying to insert/edit web part
Attempted to use an object that has ceased to exist

The resolution was to remove USING statement when using SPContext.Current.Web;

This issue happened because SPContext.Current.Web disposes the web object automatically, and by adding a

using
statement, it will try to dispose it again when there's nothing to dispose.

No comments:

Post a Comment