How to apply DropDownListFor with bootstrap?

1

I have the following code:

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

Result: link

I want to make it look something like this: link

Any solution?

    
asked by anonymous 03.01.2017 / 04:02

1 answer

2

I was able to solve it this way:

Use: link

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 })
    
09.02.2017 / 17:25