Given is the following MVC razor code which creates a dropdown from a list:
@Html.DropDownList(\"MyTestList\", null, new { @class = \"btn btn-default dropdown-t
@using (Html.BeginForm("Index", "ELibrary"))
{
@Html.DropDownListFor(m => m.Status, new SelectList(Model.StatusItems, "key", "value"), "-- Status --", new { onchange = "this.form.submit();", @class = "form-control" })
}
You just have to add @class="form-control" . It works fine. but I have also enclosed it in a Html.Begin form();