[英]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)
它是一个MVC应用程序(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
异常详细信息:System.InvalidOperationException:传递到字典中的模型项的类型为ProductController,但是此字典需要类型为ProductViewController的模型项
One of your renderings is trying to pass in the wrong object type from the Controller
to the Razor
file. 您的渲染图之一试图将错误的对象类型从
Controller
传递到Razor
文件。
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. 但是控制器动作或视图呈现被设置为传递
ProductController
对象。 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. 您需要更新视图或控制器操作,以便传递正确的模型或期望正确的模型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.