Copied to clipboard

Flag this post as spam?

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


  • Zac 223 posts 575 karma points
    May 30, 2014 @ 20:02
    Zac
    0

    Custom cshtml page in Umbraco 6 (using a reservedPath)

    Hi guys, this is a slightly odd question.

    I'm upgrading an old 4.10.1 site to Umbraco 6.2.1 (hurrah). It's been a bit of a nightmare as the site isn't that straightforward, but happily everything is working and I've updated / refactored a lot of code. One problem remains...

    The site has a .cshtml page (in the soltion, let's called it `/handlers/thing.cshtml` that was being used to render out some JSON (don't ask). There is an entry for the directory in the umbracoReservedPaths config entry (`~/handlers/`).

    In Umbraco 4, accessing this page worked ok, but in Umbraco 6 the page is 404ing. I assume this is something to do with the switch to MVC?

    Can anybody think of something obvious I might be missing? I know it's a hack but I don't want to have to rewrite this module and do it properly.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 30, 2014 @ 21:32
    Jan Skovgaard
    0

    Hi Zac

    Perhaps you need to explicitly add the path to the filename as well in the "umbracoReservedUrls" key?

    /Jan

  • Zac 223 posts 575 karma points
    May 31, 2014 @ 21:43
    Zac
    0

    Hi Jan, unfortunately it doesn't help - I still get the 404

    Any other ideas? :)

  • Zac 223 posts 575 karma points
    May 31, 2014 @ 22:17
    Zac
    100

    Got it. Silly me. This line got added during upgrades:

    <add key="webpages:Enabled" value="false"/>

    Obviously it should be

    <add key="webpages:Enabled" value="true"/>

Please Sign in or register to post replies

Write your reply to:

Draft