Add Taxonomy Field / TaxonomyWebTaggingControl to the Web part or Application Page


Here is a short code snippet to add A TaxonomyWebTaggingControl (Taxonomy Field) to the webpart/ custom control or application page.

Step 1 : Add Reference of the Assemble : Microsoft.SharePoint.Taxonomy

Step 2 : Register Taxonomy to the page.


Step 3 : Add TaxonomyWebTaggingControl to the page



Other detailed Properties can be found at taxonomywebtaggingcontrol properties.

Step 4 : Now Assigning Managed Mata Data to TaxonomyWebTaggingControl.

This can be done in two ways.
1. Statically
2. Using Code ( Dynamically).

Statically
Set four properties in the above code.
* Must Set
SspId : TermStore Id (in form of Guid)
TermSetId : TermStore Id (in form of Guid)

* Set only if IsDisplayPickerButton value is true.
SSPList : TermSet Id (in form of Guid)
TermSetList : TermSet Id (in form of Guid)

Using Code ( Dynamically).

use this code to set these values at runtime (in Page Load Event)


Note :

* Managed Metadata Service // TermStore Name
* tGroup //TermStore Group
* tTermSet //TermSet within Group

Enjoy, you can now run the application and check the output.







Search This Blog

Link Within Related Posts Plugin for WordPress, Blogger...