In My MVC Controller, Can I Add a Value to My HTML.DropDownList?
- by Aaron Salazar
In my view I have an HTML DropDownList that is filled, in my controller, using a List<string>.
<%= Html.DropDownList("ReportedIssue", (IEnumerable<SelectListItem>)ViewData["ReportedIssue"]) %>
List<string> reportedIssue = new List<string>();
reportedIssue.Add("All");
reportedIssue.Add(...);
ViewData["ReportedIssue"]…