var docTypes = Model.DocumentTypes.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).AsEnumerable(); @Html.DropDownList("SelectedDocumentType", docTypes, "--select--", new { @class = "ddSelect" })
public IEnumerable DocumentTypes { get; set; }
[HttpParamAction] [HttpPost] [ValidateInput(false)] public ActionResult Save() { int DocumentType = // I have to assign the selected value of the dropdownlist here }