Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On a Share Point 2013 site (on premise Dev Environment), in the home page we have a web part, Where we are displaying the terms (reading from Term store navigation). We are doing this by hard coding the term store navigation page URL and Required user name and password to access that term store navigation page.

But when we deploy the WSP in other servers it’s not going to work. So is there any way to read current site/site collection term store navigation page URL? And instead of hard coding the User name and password, how can we run with elevated privileges?

What I have tried:

tried to read term store navigation page URL in the code, but not working.
Posted
Updated 18-Jul-16 22:27pm

1 solution

Hi,
you have to read the navigate page url dynamically from the configuration file /list in custom code or use the below code to read term store url dynamically.


SPSecurity.RunWithElevatedPrivileges(delegate
{
SPWeb web = SPContext.Current.Web;
string siteurl = SPContext.Current.Site.Url;

TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
TaxonomyNavigationContext tnx = TaxonomyNavigationContext.Current;

}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900