Is there anyway to have a SelectList prepopulated on ViewModel with data-attributes ?
I want to do
@Html.DropdownListFor(m=> m.CityId, Model.Citi
You'll have to extend SelectListItem, and then extend DropDownListFor to use the extended SelectListItem.
Have a look at this solution:
Adding html class tag under in Html.DropDownList