示例
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection");
File oFile = oClientContext.Web.GetFileByServerRelativeUrl("/sites/MySiteCollection/SitePages/Home.aspx ");
LimitedWebPartManager limitedWebPartManager = oFile.GetLimitedWebPartManager(PersonalizationScope.Shared);
oClientContext.Load(limitedWebPartManager.WebParts);
oClientContext.ExecuteQuery();
if (limitedWebPartManager.WebParts.Count == 0)
{
throw new Exception("没有要删除的Web部件。");
}
WebPartDefinition webPartDefinition = limitedWebPartManager.WebParts[0];
webPartDefinition.DeleteWebPart();
oClientContext.ExecuteQuery();