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)
Syntax
'Declaration
Public Function GetPublishingPages ( _
camlQueryXml As String _
) As PublishingPageCollection
'Usage
Dim instance As PublishingWeb
Dim camlQueryXml As String
Dim returnValue As PublishingPageCollection
returnValue = instance.GetPublishingPages(camlQueryXml)
public PublishingPageCollection GetPublishingPages(
string camlQueryXml
)
Parameters
camlQueryXml
Type: System.StringThe 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.
Exceptions
Exception | Condition |
---|---|
[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. |
Remarks
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.
Examples
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>