Last post May 15, 2019 12:43 PM by yogyogi
May 15, 2019 05:51 AM|demoninside9|LINK
I have two partial view in my MVC project. I am using controller with views, using Entity Framework templates.
What I put my both partial view in Create.cshtml it doesn't give any error.
But when I tries same for my Index.cshtml it gives error.
I search about the error and found that I should use ViewModel instead. That is fine, but I am curious to know about that why same partial view working in 1 view but don't work for another view. And I am doing nothing special in second view.
May 15, 2019 11:38 AM|mgebhard|LINK
The concept is very simple. You've defined a strongly typed View or Partial but did not pass the defined type from the Action to the View or Partial.
May 15, 2019 12:43 PM|yogyogi|LINK
It should be like:
Check this article to understand partial views and their working:.