BuilderFactoryExtensions.BootstrapTagBox(BuilderFactory, String) Method

Creates a Tag Box control with a specified name.

Namespace: DevExpress.AspNetCore

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

Declaration

public static BootstrapTagBoxBuilder BootstrapTagBox(
    this BuilderFactory builderFactory,
    string name
)
<ExtensionAttribute>
Public Shared Function BootstrapTagBox(
    builderFactory As BuilderFactory,
    name As String
) As BootstrapTagBoxBuilder

Parameters

Type Name Description
BuilderFactory builderFactory

A BuilderFactory object providing access to Tag Box settings.

String name

A control name.

Returns

Type Description
BootstrapTagBoxBuilder

A builder for a Tag Box control.

The code sample below demonstrates how you can use this method to create a Tag Box control.

@(Html.DevExpress()
    .BootstrapTagBox("tagBoxDefault")
    .Items(items =>
    {
        items.Add()
            .Text("Item1")
            .Value("ItemValue1");
        items.Add()
            .Text("Item2")
            .Value("ItemValue2");
        items.Add()
            .Text("Item3")
            .Value("ItemValue3");
        items.Add()
            .Text("Item4")
            .Value("ItemValue4");
        items.Add()
            .Text("Item5")
            .Value("ItemValue5");
    })
    .Value(new List<string>() { "ItemValue2", "ItemValue3" }))