model-view-controllersitecoresitecore7sitecore7.5

Sitecore Wrong Route in MVC


I updated sitecore 7.0 to 7.5 and there are some controller rendering items created by MVC3.

When I execute them in 7.5, it shows an error:

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.

The name of controller is Components and action is Navigation

I worked perfectly in Sitecore 7.0. How can I fix this issue?


Solution

  • Yes, try to append "Controller" into your "components" like "componentsController" and you can also disable CommandRoutePrefix at Sitecore.Speak.Mvc.config file in /App_Config/Includes/

    Also, if you want to pass value into specific location, you can use static url instead of @Url.Action(...)