أماني مفيد

أماني مفيد

  • NA
  • 142
  • 17.4k

bind a viewdata inside dropdown list

Sep 28 2020 7:38 AM
i wanna bind a viewdata inside dropdown list , 
i use this way 
@Html.DropDownListFor(model => model.First().KEYWORD_NAME, ViewData["KEYWORD"] as IEnumerable<SelectListItem>, "Select Company Name", new { @class = "form-control" })
 
but i have this error : 
System.ArgumentNullException: 'Value cannot be null.
Parameter name: source
 i don't have any parameter with name source ? 
 i debug the project and i checked that the view data have data inside it 

how i can  fix it ? 

Answers (3)