Adding a css class to select using @Html.DropDownList()

后端 未结 10 1689
情深已故
情深已故 2020-11-30 01:13

I\'m building my first MVC application after years of doing webforms, and for some reason I am not able to make this work:

@Html.DropDownList(\"PriorityID\"         


        
10条回答
  •  自闭症患者
    2020-11-30 01:28

    You Can do it using jQuery

      $("select").addClass("form-control")
    

    here, Select is- html tag, Form-control is- class name

     @Html.DropDownList("SupplierId", "Select Supplier")
    

    and here, SupplierId is ViewBagList, Select Supplier is - Display Name

提交回复
热议问题