Reputation: 5326
I am getting the below exception and no clue of the class/method name. Just it shows me the fully qualified type names. But which dictionary? I debugged and couldn't find out the exact place as at one point, straightaway it throws this exception. Its a MVC application (Sitecore MVC)
Any help please? or clue on how to debug or fix this issue?
Description: An unhandled exception occurred.
Exception Details: System.InvalidOperationException: The model item passed into the dictionary is of type ProductController but this dictionary requires a model item of type ProductViewController
Upvotes: 0
Views: 1009
Reputation: 4266
One of your renderings is trying to pass in the wrong object type from the Controller
to the Razor
file.
Look through the renderings that you have on the page that is generating the exception. One of the razor scripts will have a model tag something like this:
@model Namespace.ProductViewController
But the controller action, or view rendering is setup to pass in a ProductController
object. You need to update either the view or the controller action so that the correct model is passed in, or the correct model is expected.
Upvotes: 1