Microsoft
70-573 · Question #74
You are creating a Web Part. You need to ensure that the Web Part activates a Feature in the subsite without causing a memory leak. Which code segment should you use?
The correct answer is B. SPFeatureCollection featuresCollect = SPContext.Current.WebFeatures. MNEMONIC RULE: "no memory leak = SPContext; subsite = WebFeatures" Gets the activated site features of the Microsoft SharePoint Foundation context. SPContext.WebFeatures Property
Developing SharePoint Solutions
Question
You are creating a Web Part. You need to ensure that the Web Part activates a Feature in the subsite without causing a memory leak. Which code segment should you use?
Options
- ASPFeatureCollection featuresCollect = SPContext.Current.SiteFeatures;
- BSPFeatureCollection featuresCollect = SPContext.Current.WebFeatures;
How the community answered
(27 responses)- A22% (6)
- B78% (21)
Explanation
MNEMONIC RULE: "no memory leak = SPContext; subsite = WebFeatures" Gets the activated site features of the Microsoft SharePoint Foundation context. SPContext.WebFeatures Property
Topics
#SPFeatureCollection#SPContext#memory leak#Feature activation
Community Discussion
No community discussion yet for this question.