NavigationTerm.GetResolvedTargetUrl method
Returns a target page address as a server-relative URL from the Url() property.
Namespace: Microsoft.SharePoint.Publishing.Navigation
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public Function GetResolvedTargetUrl ( _
browserQueryString As String, _
remainingUrlSegments As String() _
) As String
'Usage
Dim instance As NavigationTerm
Dim browserQueryString As String
Dim remainingUrlSegments As String()
Dim returnValue As String
returnValue = instance.GetResolvedTargetUrl(browserQueryString, _
remainingUrlSegments)
public string GetResolvedTargetUrl(
string browserQueryString,
string[] remainingUrlSegments
)
Parameters
browserQueryString
Type: System.StringOptional query string to merge with the query string part of the resulting URL. If it is not null or if it is not an empty string, it must be prefixed with the ? character.
remainingUrlSegments
Type: []Optional. Additional context for a catalog-friendly URL that is typically obtained from the TryParseFriendlyUrl(SPSite, String, NavigationTerm, []) method.
Return value
Type: System.String
A server-relative URL or an empty string.
Remarks
The GetResolvedTargetUrl method applies the View property to calculate a resolved server-relative URL from the TargetUrl property. If the remainingUrlSegments parameter is provided, the CatalogTargetUrl property is used instead of TargetUrl.
The returned URL includes the query parameters for term-driven pages:
TermStoreId
TermSetId
TermId
UrlSuffix
If there is no target URL, or if the NavigationLinkType object is not a FriendlyUrl, then the return value is the empty string.
Note
To retrieve the resolved address for the link type SimpleLink, use the GetResolvedDisplayUrl method instead.
The returned URL is resolved by expanding any prefix tokens such as ~site/ or ~sitecollection/ used with properties such as TargetUrl and CatalogTargetUrl.
Here are some examples of how input and output URLs might look for a root SPWeb object whose URL is /sites/site1.
Note
In this example, the “Sort=ByTitle” is a parameter that has been passed through to the target URL by sing the parameter.
Friendly URL: /sites/site1/products/shoes?Sort=ByTitle
Target URL: /sites/site1/Pages/Shoes.aspx?TermStoreId=<value>&TermSetId=<value>&TermId=<value>&Sort=ByTitle
Catalog URL: /sites/site1/products/shoes/sneaker
Target URL: /sites/site1/Pages/ShoesItem.aspx?TermStoreId=<value>&TermSetId=<value>&TermId=<value>&UrlSuffix=sneaker
See also
Reference
Microsoft.SharePoint.Publishing.Navigation namespace