I have been trying to figure out how to get the syntax correct so I can load a drop down list with a simple list of string in MVC.
What is the correct format?
The following code
@Html.DropDownList("VMO", List<string>(ViewBag.VMOList), new { @class = "form-control SearchCriteria", id = "VMO", name = "VMO", multiple = "multiple"})
gives me error
"Non-invocable member 'List<T> cannot be used like a method.
List<string>(ViewBag.VMOList)is probably the problem. Change to,new SelectList(ViewBag.VMOList). Not sure that will work though.