WebPartDefinition.DeleteWebPart Method

Deletes the Web Part from the page.

Namespace:  Microsoft.SharePoint.Client.WebParts
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

[RemoteAttribute]
public void DeleteWebPart()

ExceptionCondition
[Microsoft.SharePoint.WebPartPages.WebPartPageUserException]

The current user has insufficient permissions. Error code: -1.

When Scope is User, the current user must have permissions to add and delete personalized Web Parts. When Scope is Shared, the current user must have permissions to customize pages.

Show: