set select value in IEnumerable<SelectListItem> c# mvc [duplicate]
This question already has an answer here: MVC5 - How to set “selectedValue” in DropDownListFor Html helper 3 answers I have a IEnumerable<SelectListItem> My ViewModel public class StatusClass { public string Status { get; set; } public IEnumerable<SelectListItem> StatusList { get; set; } } I set values in to StatusList from my controller. StatusClass statusObj = new CRM.StatusClass(); List<SelectListItem> Discountdata = new List<SelectListItem>(); Discountdata.Add(new SelectListItem() { Value = "All", Text = "All" }); Discountdata.Add(new SelectListItem() { Value = "Draft", Text = "Draft" });