How to apply Dropdownlistfor with bootstrap?

Asked

Viewed 378 times

1

1 answer

2


I managed to solve it that way:

Use : https://silviomoreto.github.io/bootstrap-select/examples/#customize-menu

Then change the code:

That:

@Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries, 
                             new { @class = "form-control", @readonly = true })

To:

@Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries, 
                            new { @class = "form-control selectpicker", @readonly = true })

Browser other questions tagged

You are not signed in. Login or sign up in order to post.