Dec 12 2016 07:46 AM
I'm trying to remove some JSLinks on views, but they will not go away... can someone help me spot where i go wrong?
File oFile = context.Web.GetFileByServerRelativeUrl(view.ServerRelativeUrl);
LimitedWebPartManager limitedWebPartManager = oFile.GetLimitedWebPartManager(PersonalizationScope.Shared);
context.Load(limitedWebPartManager.WebParts, wps => wps.Include(wp => wp.WebPart.Title));
context.ExecuteQuery();
var oWebPartDefinition = limitedWebPartManager.WebParts[0]; WebPart oWebPart = oWebPartDefinition.WebPart; var props = oWebPart.Properties; context.Load(limitedWebPartManager.WebParts, wps => wps.Include(wp => wp.WebPart.Title)); context.Load(props); context.ExecuteQuery(); oFile.CheckOut(); props["JSLink"] = linkToAnAlmostemptyJs; oWebPartDefinition.SaveWebPartChanges(); oFile.CheckIn("Added JSLink", CheckinType.MajorCheckIn); context.ExecuteQuery();
Best regards
Ole "Blinded" B.
Dec 15 2016 05:42 AM