1
votes

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?

1
Do you have a controller called ComponentsController and does it inherit from Controller?DavidG
No, I don't have. I'm calling post request by using ajax by passing @Url.Action("Navigation", "Components")Jay
I don't know if it's relevant but Sitecore 7.5 does not support MVC3. It requires MVC 5.1 (see compatibility table kb.sitecore.net/articles/087164 ). Also you may need to follow the convention and rename your component to ComponentsController (while still using /api/sitecore/components/navigation path).Marek Musielak
@MarekMusielak I already checked the compatibility table and I guess you can use MVC3 version in higher version if you don't use any new features being available in MVC4 or MVC5. Is it right?Jay
@MarekMusielak I need to add that I refer only Sitecore.Mvc from its bin folder.Jay

1 Answers

1
votes

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(...)