ASP.NET Core DropDown Setup

Shield UI DropDown for ASP.NET Core is a server-side wrapper component implemented as an ASP.NET Core MVC Helper.

For a detailed guide how to setup Shield UI for your ASP.NET Core project, check out this page.

The ASP.NET Core MVC helper API is a 1:1 mapping of the JavaScript DropDown widget configuration, so you only have to get familiar with a single set of configuration options:

// JavaScript Dropdown demo
$("#dropdown").shieldDropDown({
    dataSource: {
        data: movies
    },
    cls: "ddl",
    textTemplate: "{title}",
    valueTemplate: "{id}",
    selected: 2,
    events: {
        select: function (e) {
            populateDetails(e.item.id);
        }
    }
});
// ASP.NET Core Dropdown demo
  @(Html.ShieldDropDown()
    .Name("dropdown")
    .DataSource(dsb => dsb.Data(@movies))
    .Cls("ddl")
    .TextTemplate("{title}")
    .ValueTemplate("{id}")
    .Selected(2)
    .Events(eb => eb.Select(
        @
            function (e) {
                populateDetails(e.item.id);
            }
        )
    )
)

To see the configuration options in action, please refer to our online demos.