PageLayoutCollection.Contains method

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

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

The current user does not have sufficient permissions to perform this action.

Remarks

The pageLayoutName parameter must not be empty and must be a string that is not null. The folder parameter must not be null.

See also

Reference

PageLayoutCollection class

PageLayoutCollection members

Microsoft.SharePoint.Publishing namespace