More RenderMvcControllers in one project possible?
My first RenderMvcController is working like a charm but i dont get the second one working; stronger, all request are passing the one controller i had already working...
To be honest, to me as a newbe, it is not clear wheter there are more than one RenderMvcController per project / site possible or that only a single one is allowed. And if only one is possible, how do we configure the one that is active.
I had somehwere a default-controller-settings statement.....
DefaultRenderMvcControllerResolver.Current.SetDefaultControllerType(typeof(AnimalMvcController)); Commenting it out with next action did the trick.
Folowing the above named controllername i named the next RenderMvcController along the system [DocType]MvcController instead of [DocType]Controller.
More RenderMvcControllers in one project possible?
My first RenderMvcController is working like a charm but i dont get the second one working; stronger, all request are passing the one controller i had already working...
To be honest, to me as a newbe, it is not clear wheter there are more than one RenderMvcController per project / site possible or that only a single one is allowed. And if only one is possible, how do we configure the one that is active.
Hi Willem,
It is possible to have multiple RenderMvcControllers. This principle is called route hijacking : https://our.umbraco.org/documentation/Reference/Routing/custom-controllers
The controller should be name like this :
[AliasOfDoctype]Controller where you replace [AliasOfDoctype] of with the alias of the doctype where you want to do route hijacking for.
So if your alias is TextPage the name of the controller should be TextPageController.
Dave
Hi Dave,
Red devil saves the day ;-)
I had somehwere a default-controller-settings statement..... DefaultRenderMvcControllerResolver.Current.SetDefaultControllerType(typeof(AnimalMvcController)); Commenting it out with next action did the trick.
Folowing the above named controllername i named the next RenderMvcController along the system [DocType]MvcController instead of [DocType]Controller.
Now working like a rocket.
Thanks a lot!
Hi Willem,
Glad you got it working. Don't forget to mark this post as solved so others can find the solution as well.
Dave
is working on a reply...