Skip to main content

Simple Dropdownlist MVC 5 In VB.Net

VView (.vbhtml)

              <div class="form-group">
                     @Html.LabelFor(Function(model) model.Plant, "Plant",
                         htmlAttributes:=New With {.class = "control-label col-md-2"})

                     <div Class="col-md-10">
                     @Html.DropDownList("MeSkill", New List(Of SelectListItem)() From
                        {
                            New SelectListItem() With {.Value = "1", .Text = "BKS"},
                            New SelectListItem() With {.Value = "2", .Text = "KRW"},
                            New SelectListItem() With {.Value = "3", .Text = "HO"}
                        }, " -- Pilih Plant --", New With {.class = "form-control"})
                     </div>
                 </div>

Comments