SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a menu control that read terms from taxonomy term store. Get termSet and term is straight forward

        using (SPSite siteCollection = new SPSite(siteCollecitonUrl))
            TaxonomySession taxSession = new TaxonomySession(siteCollection);
            TermStore taxStore = taxSession.TermStores[0];
            Group taxGroup = taxStore.GetSiteCollectionGroup(siteCollection);
            TermSet termSet = taxGroup.TermSets[strTermSetsName];

            foreach (term in termSet.terms)

but how to retrieve friendly URL or simple url link?

I could not find a property or method.

Thank you.

share|improve this question
Hi, after your export the URL into a CSV, how do you import it back? – Mark Aug 24 '15 at 9:50
up vote 12 down vote accepted

You have to use NavigationTerm

To Create Term set:

  NavigationTerm term2 = navTermSet.CreateTerm("Term 2", NavigationLinkType.FriendlyUrl,

/// Verify that the NavigationTermSetView is being applied correctly.

 Assert.AreEqual(web.ServerRelativeUrl + "/term-2", term2.GetResolvedDisplayUrl(null).ToString());

In order to add new terms to navigation term set, you can use the following code:

// Obtain navigation term set
NavigationTermSet navigationTermSet = NavigationTermSet.GetAsResolvedByWeb(termSet, web, "GlobalNavigationTaxonomyProvider");
// Specify that this term set can be used for site navigation
navigationTermSet.IsNavigationTermSet = true;
// Creates new term pointing to an already existing URL outside of SharePoint
NavigationTerm term = navigationTermSet.CreateTerm("Bing Search", NavigationLinkType.SimpleLink, Guid.NewGuid());
term.SimpleLinkUrl = "";
// Creates new term pointing to an existing SharePoint page
NavigationTerm term2 = navigationTermSet.CreateTerm("Target page", NavigationLinkType.FriendlyUrl, Guid.NewGuid());
term2.TargetUrl.Value = "~site/Pages/TargetPage.aspx";

Hope this helps

share|improve this answer
Anuja, thank you for the comment but it did not help. My question is if I have term store setup and simply want to retrieve term properties especially friendly URL and simple link. I do not like to create new terms by using NavigationTerm. – wming Feb 8 '13 at 17:06
Hell Anuja. Your comment did not answer my question but point to the right direction. I managed to retrieve those properties by using NavigationTermSet. – wming Feb 8 '13 at 18:37
Glad that it helps to you – Anuja Feb 10 '13 at 18:53
foreach (term in termSet.terms)
    string URL = term.LocalCustomProperties["_Sys_Nav_SimpleLinkUrl"];
share|improve this answer
This is incorrect – Eric Herlitz Jan 4 '14 at 12:51
@EricHerlitz What is incorrect about this? The solution worked for me when I tried it. – thm51mb Apr 17 '14 at 13:42
This works fairly well!! And if I am not using NavigationTermSet this has to be used (for TermSet). – Amit Maheshwari Sep 18 '14 at 6:47
I am unable to get the value using term.LocalCustomProperties["_Sys_Nav_SimpleLinkUrl"];. My navigation url is properly set in sharepoint. Any ideas ? – Behroz Sikander Dec 19 '14 at 10:48

The missing link is the bridge between TermSet and NavigationTermSet. As Anuja correctly stated, the responsible method is


So, here's my complete example - took me more than a day to figure it out (a different approach was working in an ASPX page but failed in the Web Service I was programming).

using Microsoft.SharePoint.Publishing.Navigation;
using Microsoft.SharePoint.Taxonomy;
using System;

TaxonomySession taxonomySession = new TaxonomySession(site);
StandardNavigationSettings navigationSettings = new WebNavigationSettings(site.RootWeb).CurrentNavigation;
TermStore termStore = taxonomySession.TermStores[navigationSettings.TermStoreId];
TermSet termSet = termStore.GetTermSet(navigationSettings.TermSetId);
NavigationTermSet navigationTermSet = NavigationTermSet.GetAsResolvedByWeb(termSet, site.RootWeb, StandardNavigationProviderNames.GlobalNavigationTaxonomyProvider);

foreach (NavigationTerm navigationTerm in navigationTerms)
    Console.WriteLine("navigationTerm.GetResolvedDisplayUrl(string.Empty): " + navigationTerm.GetResolvedDisplayUrl(string.Empty));

Hope that helps...

share|improve this answer
I hope it helps too - sounds like something I'm trying to do, so I'm linking and I'll return when I get to that point. I'll upvote if it does help - thanks regardless! – Code Jockey May 21 '15 at 19:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.