3
Reply

how to use dropdown in asp.net mvc 4

Udaybhan Singh

Udaybhan Singh

Oct 13 2016 7:14 AM
363
how  to use dropdown in asp.net mvc 4. i get this error after click on save button.
 There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'CountryID'
 
my code is this .
 
<td></td><td>@Html.DropDownListFor(model => model.CountryID, ViewBag.Countries as IEnumerable<SelectListItem>, new { @class = "anyclass" })</td> 

Answers (3)