Udaybhan Singh

Udaybhan Singh

  • NA
  • 164
  • 12.4k

how to use dropdown in asp.net mvc 4

Oct 13 2016 7:14 AM
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)