Here How to bind Dropdown in Static and Dynamically.
Static DropDownList:
Dynamic DropDownList:
Static DropDownList:
@Html.DropDownListFor(m=>m.CountryName,new List<SelectListItem>{
new SelectListItem{ Text="India", Value
= "1" },
new SelectListItem{ Text="US", Value
= "0" },
new SelectListItem{ Text="UK", Value = "2" }
new SelectListItem{ Text="UK", Value = "2" }
})
Dynamic DropDownList:
@Html.DropDownListFor(m=>m.CountryName,new SelectList((System.Collections.IEnumerable)ViewData["country"],"value","text"),"Select")