I am trying to remove some WebParts from a page in my site collection. Normally I can do this with SPLimitedWebPartManager.DeleteWebPart(webPart) however, that will not delete System.Web.UI.WebControls.WebParts.Part nor can I cast it to a WebPart object (it returns null).
Currently I am just setting visible attribute to false, but ideally I would like to delete it.
Any suggestions?
?contents=1query string? – Andrey Markeev Feb 3 '12 at 21:06?contents=1to a portal page url (i.e.http://site/default.aspx?contents=1), the Maintenance page will be shown, and you'll be able to delete webparts through GUI. Although the problem is solved, this is a quite useful notion anyway :) – Andrey Markeev Feb 3 '12 at 21:38