TaxonomyNavigation.TryParseFriendlyUrl method

Parses the specified absolute URL or server-relative URL to determine whether it is a friendly URL, a catalog friendly URL, or a root friendly URL.

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

Syntax

'Declaration
Public Shared Function TryParseFriendlyUrl ( _
    site As SPSite, _
    inputUrl As String, _
    <OutAttribute> ByRef friendlyUrlTerm As NavigationTerm, _
    <OutAttribute> ByRef catalogUrlSegments As String() _
) As Boolean
'Usage
Dim site As SPSite
Dim inputUrl As String
Dim friendlyUrlTerm As NavigationTerm
Dim catalogUrlSegments As String()
Dim returnValue As Boolean

returnValue = TaxonomyNavigation.TryParseFriendlyUrl(site, _
    inputUrl, friendlyUrlTerm, catalogUrlSegments)
public static bool TryParseFriendlyUrl(
    SPSite site,
    string inputUrl,
    out NavigationTerm friendlyUrlTerm,
    out string[] catalogUrlSegments
)

Parameters

  • inputUrl
    Type: System.String

    The URL to be parsed in absolute or server-relative form.

  • friendlyUrlTerm
    Type: Microsoft.SharePoint.Publishing.Navigation.NavigationTerm

    For a root friendly URL (that is, one based on the site welcome page), this output is a null reference (Nothing in Visual Basic). For a friendly URL or a catalog friendly URL, it returns the term that defines it. This parameter is onlymeaningful when the function returns true.

  • catalogUrlSegments
    Type: []

    If the input URL is a catalog friendly URL, then this output array reports the additional URL segments. If the input URL is a regular friendly URL, then the array will have zero elements. If the function returns false, then the array has zero elements.

Return value

Type: System.Boolean
true if the URL is a friendly URL, catalog-friendly URL, or root URL; otherwise, false

Remarks

If the URL is a friendly URL, a catalog friendly URL, or a root friendly URL, then this method returns true and assigns the output parameters; otherwise, it returns false.

See also

Reference

TaxonomyNavigation class

TaxonomyNavigation members

Microsoft.SharePoint.Publishing.Navigation namespace

GetTargetForRootFriendlyUrl(SPWeb)

CatalogTargetUrl