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<doctypeentity> DocumentTypes { get; set; }
[HttpParamAction] [HttpPost] [ValidateInput(false)] public ActionResult Save() { int DocumentType = ????// I have to assign the selected value of the dropdownlist here }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)