I get this error
There is no ViewData item of type 'IEnumerable' that has the key 'dropdownOne'.
[HttpGet]
public ActionResult CreateNews()
{
NewsDatabaseEntities db = new NewsDatabaseEntities();
var list = db.Categories.ToList();
ViewBag.list = (from c in list select new SelectListItem { Value = c.CategoryId.ToString(), Text = c.CategoryName.Trim() });
return View();
}
@Html.DropDownList("dropdownOne", (IEnumerable<SelectListItem>)ViewBag.list, new { @class = "form-control", multiple = "true" })