Copied to clipboard

Flag this post as spam?

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

  • Thomas Heaney 8 posts 29 karma points
    Feb 28, 2019 @ 16:12
    Thomas Heaney

    Adding custom MVC routes in v8

    Does anyone know how to add custom MVC routes in v8? With v7 I used an ApplicationEventHandler class but this is not available.

    I did make an attempt with Composers and Components but it didn't go very well.

  • Carlos Mosqueda 158 posts 247 karma points
    Feb 28, 2019 @ 16:19
    Carlos Mosqueda

    It looks like so far the documentation has not been update, as you probably saw.

    But if you want to do some digging, in the Umbraco.Web folder, there is a Routing folder and in the main Umbraco.web there is a RouteCollectionExtensions class.

  • seanrock 99 posts 173 karma points
    Mar 17, 2019 @ 10:58

    if you check the github docs repo, there is mention about compositions and that ApplicationEventHandler is gone.

  • seanrock 99 posts 173 karma points
    Mar 17, 2019 @ 14:41
  • Marc Goodson 1005 posts 6620 karma points MVP 4x c-trib
    Mar 17, 2019 @ 23:20
    Marc Goodson

    Hi Thomas

    Have knocked up an example here:

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; using Umbraco.Core.Composing; using Umbraco.Web; using Umbraco.Web.Mvc;

    namespace Umbraco8.Components {

    public class RegisterCustomRouteComposer : ComponentComposer<RegisterCustomRouteComponent>
    public class RegisterCustomRouteComponent : IComponent
        public void Initialize()
            RouteTable.Routes.MapUmbracoRoute("Product Details", "product/details/{id}", new
                controller = "SuperProduct",
                action = "Details",
                id = UrlParameter.Optional
            }, new UmbracoVirtualNodeByIdRouteHandler(1105));
        public void Terminate()
            throw new NotImplementedException();


  • Hugo Becerra 10 posts 80 karma points
    Sep 11, 2019 @ 11:35
    Hugo Becerra

    Hi guys,

    any of you have a solution for this?

    We are having this problem right now -->


Please Sign in or register to post replies

Write your reply to: