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.StringThe user-friendly text to use as the URL segment.
editableParent
Type: Microsoft.SharePoint.Publishing.Navigation.NavigationTermSetItemThe parent NavigationTermSetItem object below which this new friendly URL should be created.
doAddToNavigation
Type: System.BooleanIndicates 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.