Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Willem Luijk 24 posts 95 karma points
    Sep 08, 2015 @ 13:21
    Willem Luijk
    0

    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.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Sep 08, 2015 @ 14:46
    Dave Woestenborghs
    1

    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

  • Willem Luijk 24 posts 95 karma points
    Sep 08, 2015 @ 16:09
    Willem Luijk
    101

    Hi Dave,

    Red devil saves the day ;-)

    1. I had somehwere a default-controller-settings statement..... DefaultRenderMvcControllerResolver.Current.SetDefaultControllerType(typeof(AnimalMvcController)); Commenting it out with next action did the trick.

    2. 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!

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Sep 08, 2015 @ 16:58
    Dave Woestenborghs
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft