How to create a listbox in HTML without allowing multiple selection?

前端 未结 3 1554
轻奢々
轻奢々 2020-12-13 05:15

I don\'t have much experience in HTML. I am looking to create a simple listbox, but one of the requirements is to DISALLOW multiple selection. Most of the code for listboxes

3条回答
  •  春和景丽
    2020-12-13 05:54

    For Asp.Net MVC

    @Html.ListBox("parameterName", ViewBag.ParameterValueList as MultiSelectList, 
     new { 
     @class = "chosen-select form-control"
     }) 
    

    or

      @Html.ListBoxFor(model => model.parameterName,
      ViewBag.ParameterValueList as MultiSelectList,
       new{
           data_placeholder = "Select Options ",
           @class = "chosen-select form-control"
       })
    

提交回复
热议问题