I am attempting to use a Taxonomy Picker Control (TaxonomyWebTaggingControl) on an Application Page based on the term set configured for a User Profile property. In this scenario, I have set the Ask Me About field to use a Term Set in the User Profile Service Application. When editing a user profile through the My Site or Central Admin, the field correctly displays as a Taxonomy Picker and allows me to select values from the Term Set.

In a new Application Page, I have registered the tag prefix:

<%@ Register Tagprefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

And in the content I have added the control:

<Taxonomy:TaxonomyWebTaggingControl id="ngAskMeAbout" runat="server" />

In the Page_Load, I am first obtaining the term set from the User Profile property and then using it to get the term set from the Taxonomy Session:

var site = SPContext.Current.Site;
var context = SPServiceContext.GetContext(site);
var configMgr = new UserProfileConfigManager(context);
var propertyMgr = configMgr.ProfilePropertyManager;
var corePropertyMgr = propertyMgr.GetCoreProperties();

var askMeAbout = corePropertyMgr.GetPropertyByName("SPS-Responsibility");

var termSet = askMeAbout.TermSet;

ngAskMeAbout.Disabled = false;
ngAskMeAbout.Enabled = true;
ngAskMeAbout.Visible = true;

var taxonomySession = new TaxonomySession(site);
var termStoreId = termSet.TermStore.Id;
var termGroupId = termSet.Group.Id;
var termSetId = termSet.Id;

ngAskMeAbout.GroupId = termGroupId;

ngAskMeAbout.AllowFillIn = false;
ngAskMeAbout.IsMulti = true;
ngAskMeAbout.IsAddTerms = false;
ngAskMeAbout.IsDisplayPickerButton = true;
ngAskMeAbout.IsIncludeTermSetName = true;
ngAskMeAbout.IsUseCommaAsDelimiter = false;
ngAskMeAbout.Language = taxonomySession.TermStores[termStoreId].DefaultLanguage;
ngAskMeAbout.AnchorId = Guid.Empty;
ngAskMeAbout.ExcludeKeyword = false;
ngAskMeAbout.IsIgnoreFormatting = false;
ngAskMeAbout.IsIncludeDeprecated = false;
ngAskMeAbout.IsIncludePathData = false;
ngAskMeAbout.IsIncludeUnavailable = false;
ngAskMeAbout.IsSpanTermSets = false;
ngAskMeAbout.IsSpanTermStores = false;

When I try running this, nothing renders on the page. I have debugged/stepped through the code to verify all the IDs are getting set properly and nothing generates an error.

Any ideas?

  • Update: This code does work in a web part, however it simply does not display when displayed in an application page (in the layouts folder). Need to figure out why... Commented Jun 26, 2012 at 15:08
  • Update 2: I have narrowed this down to an issue with the My Site host. If I view the application page from elsewhere on my SharePoint site, it works fine. However, when viewing it within the My Site host (http:// localhost /my/_layouts/...) it does not display. Commented Jun 26, 2012 at 15:19

2 Answers 2


It appears that the Left Navigation control calls a JavaScript function called "HideQuickLaunchMenu()". For whatever reason, that function is undefined when it is called from my application page. And thus it breaks the JavaScript for the taxonomy control. As a remedy for my page, I added a blank function with the same name:

<script type="text/javascript">
    function HideQuickLaunchMenu() {

Doing this made the taxonomy control work properly again. That function probably exists in one of the SharePoint JavaScript files (not in Core.js or SP.js, checked those), however I was unable to find it. The code above works for me, so I will just go with that.


So, I did end up discovering the cause of the issue, however I think it is more of a bug in SharePoint:

When the solution is deployed as a Web feature to the My Site web, it causes the error to occur. If I change the solution to be a Site feature and deploy it to the My Site Site Collection, the error does not occur.

  • I am getting the same issue even if I deploy the feature as Site feature.. Do you have any idea? then please suggest...
    – users1100
    Commented Oct 3, 2013 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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