0

I am using SPContext.Current.Web.ParentWeb and I want to know if I have to dispose below:

SPContext.Current.Web.ParentWeb
4

According to the Bible of SharePoint IDisposable objects, Best Practices: Using Disposable Windows SharePoint Services Objects:

SPWeb.ParentWeb Property

Updated Guidance

An earlier version of this article recommended that the calling application should dispose of the SPWeb.ParentWeb. This is no longer the official guidance. The dispose cleanup is handled automatically by the SharePoint framework.

So, no, you do not need to dispose of this object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.