Old question, but here's another explanation of the problem. You'll get this error even if you have strongly typed views and aren't using ViewData to create your dropdown list. The reason for the error can becomes clear when you look at the MVC source:
// If we got a null selectList, try to use ViewData to get the list of items.
if (selectList == null)
{
selectList = htmlHelper.GetSelectData(name);
usedViewData = true;
}
So if you have something like:
@Html.DropDownList("MyList", Model.DropDownData, "")
And Model.DropDownData
is null, MVC looks through your ViewData for something named MyList
and throws an error if there's no object in ViewData with that name.