Share via


SPPrefixCollection.FindSiteRoot method

Looks in this collection for a prefix that matches the beginning of the server-relative request url.

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

Syntax

'Declaration
Public Function FindSiteRoot ( _
    serverRelativeRequestPath As String, _
    <OutAttribute> ByRef matchedPrefix As SPPrefix _
) As String
'Usage
Dim instance As SPPrefixCollection
Dim serverRelativeRequestPath As String
Dim matchedPrefix As SPPrefix
Dim returnValue As String

returnValue = instance.FindSiteRoot(serverRelativeRequestPath, _
    matchedPrefix)
public string FindSiteRoot(
    string serverRelativeRequestPath,
    out SPPrefix matchedPrefix
)

Parameters

  • serverRelativeRequestPath
    Type: System.String

    The server-relative request url.

Return value

Type: System.String
The portion of the server relative request url that represents a site, or null if no match could be found.

See also

Reference

SPPrefixCollection class

SPPrefixCollection members

Microsoft.SharePoint.Administration namespace