Monday, January 13, 2014

The model type is invalid. please select an item from the list ( ASP.Net MVC)

Hi,

If any one face this problem, hear is one solution

While creating/Add controller for Entity Framework in Asp.Net MVC3 OR MVC4

Example:
As per this website


  • Controller name: MoviesController. (This is the default. )
  • Template: Controller with read/write actions and views, using Entity Framework.
  • Model class: Movie (MvcMovie.Models).
  • Data context class: MovieDBContext (MvcMovie.Models).
  • Views: Razor (CSHTML). (The default.)


when we click on "Add" Button the application show one alert message "The model type is invalid. please select an item from the list"

Before adding MoviesController we need to built the project before proceed to this step.



Click on Run Button to built the project and now add controller with above steps.

I hope you problem will be solved.