Created
March 13, 2017 14:52
-
-
Save chrisobriensp/0269a57dc9c0a6a9c5123dda3e049caf to your computer and use it in GitHub Desktop.
Shows the simplest example of adding a modern web part to a SharePoint page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void addDefaultWebPartToPageSimple(ClientContext siteContext, string pageName) | |
{ | |
ClientSidePage page = new ClientSidePage(siteContext); | |
ClientSideWebPart videoEmbedWp = page.InstantiateDefaultWebPart(DefaultClientSideWebParts.VideoEmbed); | |
page.AddControl(videoEmbedWp); | |
page.Save(pageName); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment