How to apply Bootstrap dropdown style to an ASP.NET MVC DropDownList?

前端 未结 6 1178
孤街浪徒
孤街浪徒 2021-01-30 08:47

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         


        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 09:29

    Try this code :

      @Html.DropDownListFor(model => model.MovieGenreModel, SelectList,
                       new { @class = "form-control",aria_describedby="dropdownMenu1"})
    

提交回复
热议问题