Share via


PublishingPage.AddFriendlyUrl method

Adds a user-friendly URL for this PublishingPage object.

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

Syntax

'Declaration
Public Function AddFriendlyUrl ( _
    friendlyUrlSegment As String, _
    editableParent As NavigationTermSetItem, _
    doAddToNavigation As Boolean _
) As String
'Usage
Dim instance As PublishingPage
Dim friendlyUrlSegment As String
Dim editableParent As NavigationTermSetItem
Dim doAddToNavigation As Boolean
Dim returnValue As String

returnValue = instance.AddFriendlyUrl(friendlyUrlSegment, _
    editableParent, doAddToNavigation)
public string AddFriendlyUrl(
    string friendlyUrlSegment,
    NavigationTermSetItem editableParent,
    bool doAddToNavigation
)

Parameters

  • friendlyUrlSegment
    Type: System.String

    The user-friendly text to use as the URL segment.

  • doAddToNavigation
    Type: System.Boolean

    Indicates whether to add the friendly URL into the managed navigation.

Return value

Type: System.String
The new server-relative friendly URL for this PublishingPage object.

Exceptions

Exception Condition
System.ArgumentException

The friendlyUrlSegment parameter cannot be null or empty.

System.ArgumentNullException

The editableParent parameter cannot be null.

System.UnauthorizedAccessException

The current user has insufficient permissions to perform this operation.

Remarks

The editableParent parameter must be retrieved as an editable item.

See also

Reference

PublishingPage class

PublishingPage members

Microsoft.SharePoint.Publishing namespace

GetAsEditable

GetAsEditable

GetAsEditable