Поделиться через


Свойство NavigationTerm.TargetUrl

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

Пространство имен:  Microsoft.SharePoint.Publishing.Navigation
Сборка:  Microsoft.SharePoint.Publishing (в Microsoft.SharePoint.Publishing.dll)

Синтаксис

'Декларация
Public ReadOnly Property TargetUrl As CustomizableString
    Get
'Применение
Dim instance As NavigationTerm
Dim value As CustomizableString

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

Значение свойства

Тип: Microsoft.SharePoint.Publishing.CustomizableString
The URL for the PublishingPage object that is used to render a friendly URL.

Замечания

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 SPWeb object) or ~sitecollection/ (representing the server-relative URL for the associated SPSite object). These tokens are expanded by methods such s GetResolvedTargetUrl(String, []) and GetResolvedTargetUrlWithoutQuery().

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

См. также

Справочные материалы

NavigationTerm класс

Элементы NavigationTerm

Пространство имен Microsoft.SharePoint.Publishing.Navigation