Copied to clipboard

Flag this post as spam?

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


  • andrew shearer 513 posts 663 karma points
    Jan 22, 2015 @ 05:38
    andrew shearer
    0

    route hijacking in umb7

    hello

    has anyone got route hijacking working successfully in umbraco 7 as per http://umbraco.com/follow-us/blog-archive/2014/1/27/a-practical-example-of-route-hijacking-in-umbraco ?

    I get an exception

    The current request for action 'Index' on controller type 'MyExampleController' is ambiguous between the following action methods:

    System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type Terabyte.UmbracoWebsite.Controllers.Hijacking.MyExampleController
    System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type Umbraco.Web.Mvc.RenderMvcController

     

    my code worked in umbraco 6.

    thanks

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 22, 2015 @ 07:20
    Jan Skovgaard
    0

    Hi Andrew

    What exact version of Umbraco 7 are you currently using? Something might have changed since the post was written last year. Before 7.1 was released.

    Don't know if Shannons writing here helps any http://shazwazza.com/post/custom-mvc-routes-within-the-umbraco-pipeline/?

    /Jan

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 22, 2015 @ 08:14
    Dennis Aaen
    0

    Hi Andrew,

    Perhaps this post from StackOverflow can explain why you are getting this message. Try to see here: http://stackoverflow.com/questions/10668105/routing-the-current-request-for-action-is-ambiguous-between-the-following

    Hope this helps too,

    /Dennis

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Jan 22, 2015 @ 12:33
    Jeroen Breuer
    0

    Hello,

    I've got it working in the Hybrid Framework. I hope that helps.

    Jeroen

  • andrew shearer 513 posts 663 karma points
    Jan 22, 2015 @ 20:48
    andrew shearer
    0

    hi Jan,

    I'm using version 7.2.1

    I read that link but my scenario is hijacking an existing umbraco controller route, not a custom route, so slightly different.

    thanks!

  • Nirmit 24 posts 97 karma points
    Jan 22, 2015 @ 23:55
    Nirmit
    0

    Hi Andrew, I had a similar situation and got a similar exception while hijacking 'existing/default' route. I added a route for default path and received the error. However I got suggestions to use IContentProvider/IURLProvider to hijack existing route. Hope this will be helpful: http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/60621-How-to-change-default-route-in-Umbraco7

  • andrew shearer 513 posts 663 karma points
    Jan 28, 2015 @ 05:05
    andrew shearer
    0

    hi Jeroen - thanks, I used from the hybrid project to achieve what I needed. It doesn't look like you can pass control back to the default route action handler like you could in umb 6 but that's ok.

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Jan 28, 2015 @ 12:12
    Jeroen Breuer
    0

    Glad the Hybrid Framework helped. Could you please mark a post as the answer if the problem is fixed.

    Jeroen

  • 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.

Please Sign in or register to post replies