SharePoint 2013 Hosting – HostForLIFE.eu :: How to Get all Terms from the TermStore in SharePoint Using C#?
This post shows how to retrieve all the Terms from the Term Store in SharePoint Using C#. We are fetching a custom Term Set from a Custom Group.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
using (SPSite RootSite = new SPSite(SPContext.Current.Site.Url)) { using (SPWeb RootWeb = RootSite.OpenWeb()) { TaxonomySession TaxonomySession = new TaxonomySession(RootSite); TermStore termstore = TaxonomySession.TermStores["Managed Metadata Service"]; Group group = termstore.Groups["CustomGroup"]; TermSet termset = group.TermSets["CustomTermset"]; TermCollection termcoll = termset.GetAllTerms(); StringBuilder strbl = new StringBuilder(); foreach (Term term in termcoll) { strbl.Append(term.Name.ToString()); } Literal1.Text = strbl.ToString(); } } |
cheap europe sharepoint 2013 hosting,
cheap european sharepoint server 2010 hosting,
europe sharepoint 2013 hosting,
fast SharePoint 2013 Hosting,
France Sharepoint 2013 Hosting,
free SharePoint 2013 Hosting,
india SharePoint 2013 Hosting,
recommended SharePoint 2013 Hosting,
SharePoint 2013 Hosting belgium,
SharePoint 2013 Hosting germany,
SharePoint 2013 Hosting Italy,
SharePoint 2013 Hosting netherlands,
SharePoint 2013 Hosting poland,
SharePoint 2013 Hosting review switzerland,
SharePoint 2013 Hosting UK,
SharePoint Hosting 2013 Paris Server,
Spain Sharepoint 2013 Hosting,
tips SharePoint 2013 Hosting,
Top Sharepoint 2013 hosting