I'd like to make a dropdown menu in a cshtml file using Razor. I'm using a ViewModel, in which I define a list. I'd like to use that list's values as dropdown options. For this, I'mtrying:
@model GuestViewModel
...
@Html.DropDownListFor(m => m.SelectedLocation, m => m.travellocations, "Select location!")
However, for the m => m.travellocations (travellocations is a list: travellocations = new List<SelectListItem>();), it just says it cannot convert the lambda to a list. How can I access this list in such a dropdown?