Copied to clipboard

Flag this post as spam?

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


  • Craig 34 posts 268 karma points
    Aug 27, 2019 @ 13:36
    Craig
    0

    Umbraco 8 within existing MVC Application

    Hi,

    I've an existing MVC 5 application that is secured with ASP.Net Identity. I'd like to add Umbraco 8 to it so that the public facing pages of the application can be served up via Umbraco but everything that is behind the Identity login area continues to be served up by the existing MVC 5 application.

    So far I've moved my MVC pages to their own area, tested this, and have installed Umbraco but after doing that I've now lost all routing to my MVC pages.

    Has anybody got any experience of doing this? I think it's possibly Globas.asax related but I can't figure it out at the moment.

  • Shaishav Karnani from digitallymedia.com 348 posts 1627 karma points
    Aug 27, 2019 @ 14:07
    Shaishav Karnani from digitallymedia.com
    1

    Hi Craig,

    Custom Routes can be managed as provided in this link. https://our.umbraco.com/documentation/reference/routing/custom-routes

    Further, I think if you can have a separate area for your code that would be best as it will keep your views and controller to be separate. You can include your folder in umbracoReservedPaths and Umbraco Request Pipeline will ignore it.

    <add key="umbracoReservedPaths" value="/yourfolder/" />
    

    Details here:- https://our.umbraco.com/documentation/reference/config/webconfig/

    Regards,

    Shaishav

  • Steve Megson 150 posts 942 karma points MVP c-trib
    Aug 29, 2019 @ 07:28
    Steve Megson
    101

    One warning about custom routes - at the moment any routes you register will take priority over Umbraco's own routes, so it's easy to break parts of Umbraco by registering general routes like {controller}/{action}.

    That's changing, but until then you may want to replace the RegisterCustomRouteComposer in the documentation with this one, which puts your custom routes after Umbraco's routes.

    [ComposeAfter(WebFinalComposer)]
    public class RegisterCustomRouteComposer : IComposer 
    { 
      public void Compose(Composition composition)
      {
        composition.Components().Append<RegisterCustomRouteComponent>();
      }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft