Reading Pages Under a Site

Use the foll code snippet to read the pages under a site (Postings under a channel in CMS 2002 terminology):

if (PublishingWeb.IsPublishingWeb(web)){
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
// Postings under this Channels
PublishingPageCollection pages = publishingWeb.GetPublishingPages();
foreach (PublishingPage page in pages)
{
//page.Name
//page.Title;
//page.Url;
}
}

Comments

Popular posts from this blog

Linksys Wireless Connection Failure

The security validation for this page is invalid. Click Back in your Web

Power Apps toPower Automate Error - The input body for trigger 'manual' of type 'Request' did not match its schema definition , the input String does not validate against the date