I get the following error on my TaxonomyWebTaggingControl on postback: The data entered was not valid. I have copy the setting for my control in the following example: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.taxonomy.taxonomywebtaggingcontrol.aspx

anyone knows why?

  • Is there a way to set the Term to Set as the root instead of TermSet? Something like TermSet _TermSet = _Group.TermSets["Keywords"]; Term _Term = _TermSet.Term["something"] TaxonomyWebTaggingControl.TermId.Add(_Term.Id);
    – user5372
    Oct 24 '11 at 18:58
  • Kamesh, you can use TaxonomyWebTaggingControl.AnchorId to set the root term.
    – user5496
    Nov 2 '11 at 15:46

We need to reset the below properties on Page Postback

  • SSPList - This property parses your string and builds a List to setSspId property
  • GroupId - A Guid
  • TermSetList - This property parses your string and builds a List to set the TermSetId property

Refer below code

//Create taxonomy Session, term store, term set & group to pull metadata from Term Store Management

    TaxonomySession _TaxonomySession = new TaxonomySession(SPContext.Current.Site);
    TermStore _TermStore = _TaxonomySession.TermStores["Managed Metadata Service"];
    Group _Group = _TermStore.Groups["System"];
    TermSet _TermSet = _Group.TermSets["Keywords"];

//Assign the Term Store & Term Set to Taxonomy Control which helps to provide suggestions or pick metadata while you type in run time.


Hopes this helps

  • Santhosh, what does the TermSetList string look like? Is it just "guid;guid;guid" etc? The one example I've found shows a TermSet "list" of only one item.
    – Josh Korn
    May 23 '12 at 18:23
  • It looks like - surprise, surprise - that the Sharepoint Create Column page doesn't support many of the available options.
    – Josh Korn
    May 23 '12 at 18:29

The WebTaggingControl will return false if the term entered is invalid or duplicate enties of the term exist. The example you're pointing to doesn't allow to fill in new terms, so you have to enter a term that already exist in the termset/group you're pointing to.

  • The term was selected by the tree control that the TaxonomyWebTaggingControl has. So the term is valid. Aug 1 '11 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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