Himaan Singh Himaan Singh - 6 months ago 35
CSS Question

Dropdownlist in mvc with bootstrap theme

i have a Dropdownlist that contains fields from the model that i have created

as below:

@Html.DropDownList("SelectedFieldId", new SelectList(Model.Fields, "FieldID","NiceName", Model.SelectedFieldId), new { @class = "dropdown", role = "menu",datatoggle = "dropdown" })


this takes default theme of mvc4, but i want to use bootstrap theme.
I have included all bootstrap files in bundles
and everything is fine except i dont know how to make this type of dropdown show in bootstrap theme.
Any help will be much appreciated thank you so much for your time.

Answer
@Html.DropDownList
    ("SelectedFieldId", new SelectList(Model.Fields, "FieldID","NiceName",
  Model.SelectedFieldId),
 new { @class = "form-control", role = "menu",datatoggle = "dropdown" })