Copied to clipboard

Flag this post as spam?

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


  • Craig Cronin 304 posts 503 karma points
    Aug 28, 2017 @ 17:27
    Craig Cronin
    0

    Surface controller path issue

    Hopefully somebody can help but its been driving me potty all afternoon.

    I'm doing a call on a surface controller @Url.Action("","")

    But for some reason its coming up with a url /sitemap instead of /umbraco/surface...

    I have checked the web.config and there are no rewrite rules there but I can't find where this is happening?

    This has been working 7.6.4

  • Damiaan 442 posts 1302 karma points MVP 6x c-trib
    Aug 28, 2017 @ 18:36
    Damiaan
    0

    Custom routes or controllers maybe?

  • Craig Cronin 304 posts 503 karma points
    Aug 28, 2017 @ 18:39
    Craig Cronin
    0

    There were a couple of custom routes in the web.config but this is for uCommerce and are fine.

    How can controller change the route from /umbraco/surface/...

    It's killing me....

    This was working, its almost like something has a custom route but I can't find it

  • Damiaan 442 posts 1302 karma points MVP 6x c-trib
    Aug 28, 2017 @ 18:49
    Damiaan
    0

    I meant routes.MapUmbracoRoute. No custom routes messing up?

    What is the html from the form? Are you using @Html.BeginUmbracoForm<ControllerName>("actionName") ? Saved me a few times as the non-generic version was doing strange things.

    My best guess was that two controllers exist with the same name messing up MVC routing.

    If it worked before, I would try to check out the previous commit and see if it still works.

  • Craig Cronin 304 posts 503 karma points
    Aug 28, 2017 @ 18:54
    Craig Cronin
    0

    Thanks Damiaan

  • Craig Cronin 304 posts 503 karma points
    Aug 29, 2017 @ 07:05
    Craig Cronin
    100

    This freaked me out and was something so stupid.

    Whilst having a tidy up exercise of my project I renamed my surface controller but had't changed in my global ajax calls.

    I would think it would give some time of error but instead give me an obscure url e.g instead of /umbraco/surface/controller/action it gave me /sitemap/controller/action

    It made me feel like there was route hijacking or something.....

    My god did I learn the hard way.

  • 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