Share via


TaxonomyField.GetFilteringHtml method

Constructs an HTML string that can be rendered to display a list of Term objects that can be used to filter on the specified TaxonomyField object.

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

Syntax

'Declaration
Public Shared Function GetFilteringHtml ( _
    filterValues As String, _
    field As SPField, _
    queryStr As String _
) As String
'Usage
Dim filterValues As String
Dim field As SPField
Dim queryStr As String
Dim returnValue As String

returnValue = TaxonomyField.GetFilteringHtml(filterValues, _
    field, queryStr)
public static string GetFilteringHtml(
    string filterValues,
    SPField field,
    string queryStr
)

Parameters

  • filterValues
    Type: System.String

    A string containing the default HTML that will be rendered by SharePoint Foundation if this method is unable construct a custom HTML string.

  • queryStr
    Type: System.String

    The URL query string containing the GUID of the Term that is currently used as the filter and a flag indicating whether any of its descendants are to be included in the filter results.

Return value

Type: System.String
An HTML string that can be rendered to display a list of Term objects that can be used to perform filtering on the specified TaxonomyField object.

Remarks

If the filterValues parameter is a null reference (Nothing in Visual Basic) or empty, or the field parameter is not of type TaxonomyField, or the TaxonomyField it encapsulates is an Enterprise Keywords field, the HTML string supplied bythe filterValues parameter is returned. Otherwise a custom HTML string is returned that can be used to render the filter values.

If the queryStr parameter contains both the key-value pairs matching "FilterField([0-9]+)=”" and “FilterData([0-9]+)= for the specified field, the value from the second pair is assumed to be of the form [[0-1],GUID]. If the first part is 1, then all descendants of the Term identified by GUID will be included in the filter results.

The constructed HTML string contains a single nested unordered list ([UL]) that contains information about the filtering Term and the list item IDs of the filtered list items. Descendant Term objects will be included in the filtering if the queryStr parameter indicates as such.

See also

Reference

TaxonomyField class

TaxonomyField members

Microsoft.SharePoint.Taxonomy namespace

Microsoft.SharePoint.Taxonomy

Microsoft.SharePoint