Hi,have a dropdown in my view, couple of other controls and a input button to save the data.On saving I have ActionReult Save ()which needs the value I selected in the dropdownlist.How can I get the selected value of the dropdownlist on my controller Actionresult Save()View:------
Collapse | Copy Codevar docTypes = Model.DocumentTypes.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).AsEnumerable(); @Html.DropDownList("SelectedDocumentType", docTypes, "--select--", new { @class = "ddSelect" })
Model:-----
Collapse | Copy Codepublic IEnumerable DocumentTypes { get; set; }
Controller:-----------
Collapse | Copy Code[HttpParamAction] [HttpPost] [ValidateInput(false)] public ActionResult Save() { int DocumentType = // I have to assign the selected value of the dropdownlist here }