Monday, 9 December 2013

There is no ViewData item of type 'IEnumerable' that has the key

This can be the problem when you are using and item from viewbag which is not set from the controller. Set the item in view bag from controller and refresh again.





Sample code:
public ActionResult Create()
        {

ViewBag.SprintTeamId = new SelectList(db.SprintTeams, "Id", "SprintTeamName");
            return View();
        
        }

No comments:

Post a Comment