Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PublishingPageInformation publishingPageInfo = new PublishingPageInformation();
- publishingPageInfo.Name = pageFileName // Set file name here;
- publishingPageInfo.PageLayoutListItem = layout // Url of the page layout inside master page gallery;
- // Adding new page to web.
- PublishingPage publishingPage =pubWeb.AddPublishingPage(publishingPageInfo);
- publishingPage.ListItem["Title"] = pageTitle; //title of the page
- publishingPage.ListItem.Update();
- _ctx.Load(publishingPage.ListItem);
- _ctx.ExecuteQuery();
- pageURL = publishingPage.ListItem["FileRef"].ToString(); // this will give you the URL of the page added
Add Comment
Please, Sign In to add comment