Hi
I have created a webpart and installed solution. When i deactivated the feature it is deleted from the webpart gallery but not deleted from the referenced page.
Below is the code i have written.
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
SPList lst = site.RootWeb.GetCatalog(SPListTemplateType.WebPartCatalog);
foreach (SPListItem itm in lst.Items)
{
if (itm.Name.Contains("NormalWebpart"))
{
itm.Delete();
break;
}
}
}
Do i need to remove webpart from the referenced pages also?
How i can remove?