PublishingWeb.GetPublishingPages method (String)

Gets a collection of PublishingPage objects contained in this PublishingWeb object.

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

public PublishingPageCollection GetPublishingPages(
	string camlQueryXml


Type: System.String

The CAML query XML parameter that is used to determine the sort order, filtering, and other properties for the PublishingPageCollection objects that have been retrieved.

Return value

Type: Microsoft.SharePoint.Publishing.PublishingPageCollection
A PublishingPageCollection collection containing PublishingPage objects in this PublishingWeb, based on the camQueryXml argument.


The camlQueryXml parameter is a null reference (Nothing in Visual Basic).


The collection retrieval failed. The CAML query may not be valid.


The site is not valid. The Pages document library is missing.

This method gets PublishingPage objects that are contained in this PublishingWeb class, based on the query information provided in the camlQueryXml argument. No item (row) limit applies to the collection; that is, no data paging occurs.

The camlQueryXml argument passed in this method is equivalent to the Query property.

You can use the CAML <OrderBy> tag to sort the collection. For example, to order a collection in ascending order based on title, use this CAML query.

<FieldRef Name="Title" Ascending="TRUE">

You can use the CAML <Where> tag to filter the collection. For example, to filter a collection based on the title matching the value "abc", use this CAML query.

<FieldRef Name="Title">
<Value Type="Text">abc</Value>