MVC 中的 Sitecore 错误路由

Sitecore Wrong Route in MVC

我将 sitecore 7.0 更新到 7.5,并且有一些由 MVC3 创建的控制器渲染项。

当我在 7.5 中执行它们时,它显示错误:

Could not create controller: 'Components'. The current route url is: 'api/sitecore/{controller}/{action}'. `Message: The controller for path '/api/sitecore/Components/Navigation' was not found or does not implement IController.

控制器名称是Components,动作是Navigation

我在 Sitecore 7.0 中工作得很好。 我该如何解决这个问题?

是的,尝试将 "Controller" 附加到您的 "components" 中,例如 "componentsController",您还可以在 /App_Config/Includes/[=13] 中的 Sitecore.Speak.Mvc.config 文件中禁用 CommandRoutePrefix =]

此外,如果您想将值传递到特定位置,可以使用静态 url 而不是 @Url.Action(...)