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 put a web part on a page through a feature.

I deactivate the feature.

Then when I go to activate it again, i loop through the wpManager.WebParts to determine if it is already on the page

using (SPLimitedWebPartManager wpManager = site.GetLimitedWebPartManager(url + page, System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)) {
      try {
         SPLimitedWebPartCollection existingParts = wpManager.WebParts;

         //I loop through checking to see if it is on the page) here
    ...

If I manually activate/deactivate it all works fine. The problem occurs when I activate the feature from another feature. Yes, I have one feature that acts as a wrapper which then activates other features in a particular order. Well, when activating this wrapper and doing the loop above the existingParts.Count = 0

I cannot explain this behavior. Ideas?

share|improve this question

closed as off-topic by SPArchaeologist, Benny Skogberg Jan 17 at 9:20

  • This question does not appear to be about SharePoint within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Can you give us some more details about for instance your "wrapper" works (and looks like in code)? –  Wictor Wilen MCA MCM MVP Sep 26 '10 at 8:33
    
What scope is this other Feature? –  James Love Jul 28 '11 at 10:15
    
@dave check the properties, I don't think they are coming through as expected to the child feature, wrong scope is the most likely scenario as James Love suggested. –  Hugh Wood Nov 13 '12 at 17:20
1  
This question appears to be off-topic because it is older than three months, the poster of the question hasn't been seen for three months and it contains no answers or no upvoted answers. (see meta.sharepoint.stackexchange.com/questions/1014/…) –  SPArchaeologist Jan 17 at 8:45

Browse other questions tagged or ask your own question.