I'm trying to pass a list of a few items to a view via the ViewData to create a drop down list. This shouldn't be too difficult, but I'm new to MVC, so I'm probably missing something obvious.
The controller assigns the list to the ViewData:
ViewData["ImageLocatons"] = new SelectList(gvr.ImageLocations);
and the view tries to render it into a drop down list:
<%= Html.DropDownList("Location", ViewData["ImageLocations"] as SelectList) %>
However, when I run it, I get this error: There is no ViewData item of type 'IEnumerable' that has the key 'Location'.
Any ideas why this isn't working? Also, shouldn't it be looking for the key "ImageLocations" rather than location?