Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

SPContext.Current.Web.ParentWeb
share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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