简体   繁体   中英

Sitecore MVC - An unhandled exception was generated during the execution of the current web request

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM