Export (0) Print
Expand All

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
)

Parameters

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.

ExceptionCondition
[System.ArgumentNullException]

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

[Microsoft.SharePoint.SPException]

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

[Microsoft.SharePoint.Publishing.InvalidPublishingWebException]

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.

<br/>
<OrderBy>
<FieldRef Name="Title" Ascending="TRUE">
</FieldRef>
</OrderBy>
<br/>

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.

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

Community Additions

Show:
© 2014 Microsoft