Skip to main content

BootstrapTagBoxValues<TKey> Class

Gets required TagBox values (predefined or custom tags) on the controller side and passes these values to the control.

Namespace: DevExpress.AspNetCore.Bootstrap

Assembly: DevExpress.AspNetCore.Bootstrap.v18.2.dll


public class BootstrapTagBoxValues<TKey> :

Type Parameters

Name Description

Type of a tag value’s field used in a TagBox control.



Bootstrap Controls for ASP.NET Core are in maintenance mode. We don’t add new controls or develop new functionality for this product line. Our recommendation is to use the ASP.NET Core Controls suite.

Using the BootstrapTagBoxValues<TKey> class only makes sense once custom tags are activated in the Tag Box control. To do this, enable the AllowCustomTags property.


This class requires that the control not use the Loading items on demand feature. Otherwise, obtain tag box values via a List<string>-type model and manually detach predefined tags (which an end-user can select from a Tag Box drop-down list) from custom tags (which are not listed in the Tag Box control but manually entered by an end-user).

The BootstrapTagBoxValues<TKey> class provides you with the following features:

To bind a control to both custom tags and predefined tags, pass a model of the BootstrapTagBoxValues<TKey> type to the Tag Box control. The code below demonstrates this approach in detail.

 @model BootstrapTagBoxValues<int>

<form method="post">
        .BootstrapTagBoxFor(m => m)
        .Items(items =>
              .Text("Item 1")
    <button type="submit" class="btn btn-primary">Submit</button>

For more information on the Tag Box control, refer to the Tag Box online demo.


The following example demonstrates how to use the BootstrapTagBoxValues class with a Tag Box that allows custom tags.

BootstrapTagBox for ASP.NET Core - How to use the BootstrapTagBoxValues class




See Also