Search code examples
c#asp.net-mvcentity-frameworkrazorscaffolding

Not getting the connection between the passing data from model and controller to view


i am deadly stuck at one place i tried scaffolding using various sites but now i am totally confused about the thing to do.
I have a project divided into there parts from them 2 are class libraries and one is main mvc project as shown here.Image showing my project directory


Now i added entity model in .Dal and i added references for each other as per needs. I tried to make a controller using scaffolding and it was success.
But the main problem is i cannot solve this error continuosly coming on running the project.
The error is this:The error i am experiencing


This is the method i am calling from controller as follows: Controller method

The view page: The View page definitions of the controller


I done this while adding controller with scaffolding: The options selected while adding controller


Solution

  • The error clearly states that your view is expecting a different view Model & a list is being passed from controller. Crosscheck your code once & check the references for the view Model.