Compartilhar via


TaxonomyFieldControl.GetTaxonomyValue Method

Converts a string to a TaxonomyFieldValue object.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)

Syntax

'Declaration
Public Shared Function GetTaxonomyValue ( _
    text As String _
) As TaxonomyFieldValue
'Usage
Dim text As String
Dim returnValue As TaxonomyFieldValue

returnValue = TaxonomyFieldControl.GetTaxonomyValue(text)
public static TaxonomyFieldValue GetTaxonomyValue(
    string text
)

Parameters

  • text
    Type: System.String

    String to be converted into a TaxonomyFieldValue object

Return Value

Type: Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue
The TaxonomyFieldValue object that is created from the string text

Exceptions

Exception Condition
ArgumentException

If a null or empty string is passed in, an argument exception is thrown.

Remarks

The string that is passed in must be formatted with a label and its GUID must be delimited with a | character. You can repeat the format more than one time and delimit it with a ; character,This method can also be used with a full GUID path. For example, if you have the Term object named X with the GUID 12345678-1234-1234-1234-123456789012, and you have the parent Term named Y at the root of the TermSet object with the GUID 87654321-4321-4321-4321-210987654321, you can use either of the following values: X|12345678-1234-1234-1234-123456789012, or X|87654321-4321-4321-4321-210987654321|123456789-1234-1234-1234-123456789012.

See Also

Reference

TaxonomyFieldControl Class

TaxonomyFieldControl Members

Microsoft.SharePoint.Taxonomy Namespace