Copied to clipboard

Flag this post as spam?

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


  • anthony hall 222 posts 536 karma points
    Aug 08, 2014 @ 11:17
    anthony hall
    0

    hijack controller not routing when parent is also a hijack

    HI all, 

    I have the following tree

    - Account
    - Reset

    Both have implement a Hijack controller. My issue is that when ever Reset is the child of Account the account controller is always called.  When Reset is not a child of account the controller is called correctly.  ie the following tree works. 

    - Account
    - Reset

    Am i missing a trick here?

     

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Aug 08, 2014 @ 11:58
    Jeroen Breuer
    0

    Hello,

    Could you post the code of your controllers?

    Jeroen

  • anthony hall 222 posts 536 karma points
    Aug 08, 2014 @ 12:08
    anthony hall
    1

    I should point out. I'm on version 6.20 ( just relised i'm in the umbraco 7 forum ) 

    Here are my controllers.  Please note both hijack controllers work when there is no parent hijack. ie when Reset is a child of Account it reverts to the Account controller. 

     

        public class PortalAccountController : Umbraco.Web.Mvc.RenderMvcController
        {
    
            public PortalAccountController()
            {
    
            }
    
            public override ActionResult Index(RenderModel model)
            {
                return View(model);
            }
    
        }
    
        public class PortalResetController : Umbraco.Web.Mvc.RenderMvcController
        {
    
            public PortalResetController()
            {
    
            }
    
            public override ActionResult Index(RenderModel model)
            {
                return View(model);
            }
    
        }
  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Aug 08, 2014 @ 12:10
    Jeroen Breuer
    1

    Hmm route hijacking should happens based on the documenttype name (controller name) and template name (ActionResult name). It should not be related to parents so it's very strange.

    Jeroen

     

  • anthony hall 222 posts 536 karma points
    Aug 08, 2014 @ 12:25
    anthony hall
    100

    Hi Jereon, really appreciate the sanity check.  Which got me thinking maybe there was some other race conditon at play here.  

    Turns out i had an over extending Url rewritting rule. Thanks again.  

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Continue discussion

Please Sign in or register to post replies