Share via


NavigationTerm.TargetUrl property

Gets the URL of a publishing page that is used to render a friendly URL.

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

Syntax

'Declaration
Public ReadOnly Property TargetUrl As CustomizableString
    Get
'Usage
Dim instance As NavigationTerm
Dim value As CustomizableString

value = instance.TargetUrl
public CustomizableString TargetUrl { get; }

Property value

Type: Microsoft.SharePoint.Client.Publishing.CustomizableString
The URL for the PublishingPage object that is used to render a friendly URL.

Remarks

This property is only supported when the LinkType is NavigationLinkType.FriendlyUrl. Attempting to change the link type causes an InvalidOperationException to be thrown.

This property is a CustomizableString object, and the default value is inherited from the TargetUrlForChildTerms.Value property of the parent NavigationTerm object or the NavigationTermSet object if there is no parent term.

The web server rewrites URLs to render the friendly URL for a navigation term by using the page that is specified by the TargetUrl property. For example, for the term "Cameras", the URLs might look like this: Friendly URL: http://example.com/products/cameras Target URL: /store/Pages/TopicTemplate.aspx

The target URL may contain tokens such as ~site/ ~site/ (representing the server-relative URL for the associated Web object) or ~sitecollection/ (representing the server-relative URL for the associated Site object). These tokens are expanded by methods such as GetResolvedTargetUrl(String, []) and GetResolvedTargetUrlWithoutQuery().

The NavigationTerm.TargetUrl property is only used when the link type is a friendly URL.

See also

Reference

NavigationTerm class

NavigationTerm members

Microsoft.SharePoint.Client.Publishing.Navigation namespace