Share via


PageLayoutCollection.Contains Method

Determines if a PageLayout with a specific name exists in the specified SPFolder.

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

Syntax

'Declaration
Public Function Contains ( _
    pageLayoutName As String, _
    folder As SPFolder _
) As Boolean
'Usage
Dim instance As PageLayoutCollection
Dim pageLayoutName As String
Dim folder As SPFolder
Dim returnValue As Boolean

returnValue = instance.Contains(pageLayoutName, _
    folder)
public bool Contains(
    string pageLayoutName,
    SPFolder folder
)

Parameters

  • pageLayoutName
    Type: System.String
    Name of the PageLayout to search for.

Return Value

Type: System.Boolean
True if a PageLayout with a specific name is found within the specified SPFolder; otherwise false.

Exceptions

Exception Condition
ArgumentNullException

Indicates that one of the input parameters is a null reference (Nothing in Visual Basic).

UnauthorizedAccessException

Current user does not have sufficient permissions to perform this action.

Remarks

The pageLayoutName parameter must be a non-empty, non-null string. The folder parameter must be non-null.

See Also

Reference

PageLayoutCollection Class

PageLayoutCollection Members

Microsoft.SharePoint.Publishing Namespace