Search code examples
c#sharepointsharepoint-2007mossweb-parts

Deactivating web part feature in sharepoint


I've developed a web part using the wspbuilder tool (Web part with feature).

When deployed (to a site collection), you have to activate the feature in order to use this web part - so far so good.

However, when deactivating the feature, the web part remains on any site where it's been added, and furthermore, it's still available in the web part gallery?

Is this expected behaviour? Is there no way of removing the web part from all subsites in the site collection, and also remove it from the web part gallery?

Thanks ;)


Solution

  • This is expected behavior. You could remove it automatically, but you would have to write a feature receiver to accomplish that.

    More info about creating a feature receiver for SharePoint 2007: http://sharepointdevwiki.com/display/public/How+to+add+a+Feature+Receiver+to+a+Feature