TermProperty class
Provides a Web Part that renders a property of a Term, such as its default label, description, path, ID, or the value of one of its custom properties.
Inheritance hierarchy
System.Object
System.Web.UI.Control
System.Web.UI.WebControls.WebControl
System.Web.UI.WebControls.Panel
System.Web.UI.WebControls.WebParts.Part
System.Web.UI.WebControls.WebParts.WebPart
Microsoft.SharePoint.WebPartPages.WebPart
Microsoft.SharePoint.Taxonomy.TermProperty
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public NotInheritable Class TermProperty _
Inherits WebPart
'Usage
Dim instance As TermProperty
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public sealed class TermProperty : WebPart
Remarks
The TermStoreID, TermSetID, TermID and Property properties are required to load the correct term and render the desired term property.
If either the term or the requested property is not found, the Web Part will render nothing.
This Web Part is the Term analogue to the ListItemProperty control that allows the author to render a property of a list item on the page.
The following code example uses the TermProperty control to render the name of a term with the specified IDs.
<Taxonomy:TermProperty
TermID="4E2C0A64-A458-4287-8D00-147C4CBE11D0"
TermSetID="9BFD8D2B-C391-49D5-A883-2B6CCF071CF1"
TermStoreID="2B8BA5E1-3A8A-4C1A-8999-DB50550342CA"
Property="Title"
runat="server"/>
The next example uses the TermProperty control to render the value of a custom property defined on the term with key TargetUrl".
<Taxonomy:TermProperty
TermID="4E2C0A64-A458-4287-8D00-147C4CBE11D0"
TermSetID="9BFD8D2B-C391-49D5-A883-2B6CCF071CF1"
TermStoreID="2B8BA5E1-3A8A-4C1A-8999-DB50550342CA"
Property="CustomProperty:TargetUrl"
runat="server"/>
Thread safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.