<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Hans Leautaud</title><link href="http://world.optimizely.com" /><updated>2014-05-20T06:00:00.0000000Z</updated><id>https://world.optimizely.com/blogs/Hans-Leautaud/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>Using New Relic with EPiServer 7+</title><link href="https://world.optimizely.com/blogs/Hans-Leautaud/Dates/2014/5/Using-New-Relic-with-EPiServer-7/" /><id>&lt;p&gt;Since a few months I am installing New Relic for all new projects I develop. I hope we all know how awesome New Relic is and if you do not know, go check it out. Since I developed a few new sites in EPiServer 7 and EPiServer 7.5 I had to add New Relic functionality to those projects. In this blogpost I would like to tell you how I did this so that maybe it can help you in the future.&lt;/p&gt;  &lt;h2&gt;Install New Relic in your solution&lt;/h2&gt;  &lt;p&gt;Installing New Relic in your project is very easy. Just get the NuGet package from &lt;a href=&quot;https://www.nuget.org/packages/NewRelic.Agent.Api/&quot;&gt;NuGet.org&lt;/a&gt; and pick NewRelic.Agent.Api.&lt;/p&gt; &lt;figure&gt;&lt;img title=&quot;2014-05-19_1906&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;2014-05-19_1906&quot; src=&quot;/link/83207e554c60453ab53b3c64119ae55a.png&quot; width=&quot;554&quot; height=&quot;286&quot; /&gt;&lt;/figure&gt;   &lt;p&gt;If you are using an Azure website or webrole, make sure you follow the &lt;a href=&quot;https://docs.newrelic.com/docs/dotnet/installing-the-net-agent-on-azure&quot;&gt;New Relic documentation&lt;/a&gt; on that matter. I won&#39;t go into that further.&lt;/p&gt;  &lt;p&gt;When using New Relic, it needs to be told for which application it is gathering information. Therefore this next line should be in your appSettings:&lt;/p&gt;  &lt;pre&gt;&amp;lt;add key=&amp;quot;NewRelic.AppName&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;p&gt;After this you have New Relic installed in your project and you can use it. It&#39;s that simple. However, there are some nice extension possibilities which we can use to get more out of New Relic.&lt;/p&gt;

&lt;h2&gt;HTTP module&lt;/h2&gt;

&lt;p&gt;To help New Relic gather all the information needed it should be helped a little bit. It works great with standard WebForms or MVC applications but with Content Management Systems which create dynamic URLs it works a little bit different. For example, a single EPiServer instance can contain multiple websites. When you do nothing about that, New Relic does not know which site is being used and all your data is aggregated on one giant heap. To fix that you can create a HTTP module which is fairly easy to understand and implement.&lt;/p&gt;

&lt;pre&gt;public class NewRelicHttpModule : IHttpModule&lt;br /&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public void Init(HttpApplication context)&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.AuthenticateRequest += this.OnAuthenticateRequest;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public void Dispose()&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; /// &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; /// Catch the authenticate request. This is the only event in which the new transaction name can be set.&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; /// &amp;lt;param name=&amp;quot;sender&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; /// &amp;lt;param name=&amp;quot;eventArgs&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private void OnAuthenticateRequest(object sender, EventArgs eventArgs)&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string sitename = SiteDefinition.Current.Name;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (EPiServer.Configuration.Settings.Instance == null || String.IsNullOrWhiteSpace(sitename)) return; //maybe specify url&#39;s which do not need to be reported to New Relic&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const string CATEGORY = &amp;quot;Uri&amp;quot;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string path = HttpContext.Current.Request.Url.AbsolutePath;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Set the path to &#39;/Home&#39; if empty. Otherwise &#39;Root Path&#39; will be reported in the New Relic dashboard without any site indication.&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (path.Length == 0) path = &amp;quot;/Home&amp;quot;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string transaction = String.Format(&amp;quot;[{0}]{1}&amp;quot;, sitename, path);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NewRelic.Api.Agent.NewRelic.SetTransactionName(CATEGORY, transaction);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;
}&lt;/pre&gt;

&lt;p&gt;As you can see in the code snippet above, you could decide not to log a specific url if needed. Also, in the transaction variable, the site name which is resolved by EPiServer is injected in the transaction name. That way you will always know which site is being used.&lt;/p&gt;
&lt;figure&gt;&lt;img title=&quot;2014-05-19_2021&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;2014-05-19_2021&quot; src=&quot;/link/0b433c575d0b40bca670404c39d0bc84.png&quot; width=&quot;395&quot; height=&quot;167&quot; /&gt;&lt;/figure&gt; 

&lt;p&gt;In the screenshot above you can see how the transactions are being logged in New Relic. Also notice the Catalogus.Get method. This is a separate WebAPI call which, in this application, is excluded in the HTTP module.&lt;/p&gt;

&lt;p&gt;Once you are done, you only need to add the HTTP module to your system.webServer/modules node in your web.config.&lt;/p&gt;

&lt;pre&gt;&amp;lt;add name=&amp;quot;NewRelic&amp;quot; type=&amp;quot;Framework.Core.Performance.NewRelicHttpModule, Framework.Core&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;h2&gt;Log4Net appender&lt;/h2&gt;

&lt;p&gt;When a 500 error occurs you probably want to log this in New Relic. That way it gives you inside in your application and as a bonus you can configure some alerts so that you receive an e-mail or text message when your application is throwing too many exceptions. To let New Relic know when an exception is thrown I created a simple Log4Net appender which sends the exception to New Relic when a message with the loglevel ERROR or FATAL is logged.&lt;/p&gt;

&lt;pre&gt;public class NewRelicAppender : AppenderSkeleton&lt;br /&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; protected override void Append(LoggingEvent loggingEvent)&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (loggingEvent == null) return;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (loggingEvent.Level == Level.Error || loggingEvent.Level == Level.Fatal)&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NewRelic.Api.Agent.NewRelic.NoticeError(loggingEvent.ExceptionObject);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
}&lt;/pre&gt;

&lt;p&gt;As you can see, very easy. You can pass in the ExceptionObject directly into the NoticeError method of the New Relic API. &lt;img title=&quot;2014-05-19_2054&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;2014-05-19_2054&quot; src=&quot;/link/9be45caaa8e145978f15e116a4abb02c.png&quot; width=&quot;554&quot; height=&quot;192&quot; /&gt; &lt;/p&gt;

&lt;p&gt;Just add the appender to your EPiServerLog.config:&lt;/p&gt;

&lt;pre&gt;&amp;lt;appender name=&amp;quot;NewRelicAppender&amp;quot;&lt;br /&gt;type=&amp;quot;Framework.Core.Diagnostics.NewRelicAppender&amp;quot;&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;threshold value=&amp;quot;ERROR&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/appender&amp;gt;&lt;br /&gt;&amp;lt;root&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;level value=&amp;quot;INFO&amp;quot; /&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;appender-ref ref=&amp;quot;NewRelicAppender&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/root&amp;gt;&lt;/pre&gt;

&lt;h2&gt;Other cool New Relic goodies&lt;/h2&gt;

&lt;p&gt;New Relic has a lot more interesting features you should check out. You could Record metrics or increment counters. Check out the &lt;a href=&quot;https://docs.newrelic.com/docs/dotnet/net-agent-api&quot;&gt;New Relic API documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this blog can help you implement New Relic. If you have any questions or comments, feel free to enter them below.&lt;/p&gt;</id><updated>2014-05-20T06:00:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Resolving an URL without {node} or {action}</title><link href="https://world.optimizely.com/blogs/Hans-Leautaud/Dates/2014/4/Resolving-a-URL-without-node-or-action/" /><id>&lt;p&gt;For a website we’re creating I had to create a route for customers who would sign in for the first time. This URL had to be simple and should contain a unique key for us to know which user was accessing the page. How and with what we created this key is not important for now.&lt;/p&gt;  &lt;p&gt;The URL we wanted to use was https://www.website.com/welcome/{unique code}.&lt;/p&gt;  &lt;p&gt;I tried this with the default code to register a content route:&lt;/p&gt;  &lt;pre&gt;routes.MapContentRoute(&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;quot;welcome_page&amp;quot;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;quot;welcome/{id}&amp;quot;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; new { node = &amp;quot;home&amp;quot;, action = &amp;quot;index&amp;quot; }
);&lt;/pre&gt;

&lt;p&gt;This did not work and I submitted a &lt;a href=&quot;/link/fc381bdecd174d64805219a8a3dd375b.aspx&quot; target=&quot;_blank&quot;&gt;forum post&lt;/a&gt;. The solution presented did not work for me the way I wanted. I figured out that routing was not working for me at all so I posted another &lt;a href=&quot;/link/33594577b3a4419e9a50591247d91e70.aspx&quot; target=&quot;_blank&quot;&gt;forum post&lt;/a&gt;. Again &lt;a href=&quot;http://world.episerver.com/System/Users-and-profiles/Community-Profile-Card/?userid=748045d9-fea9-db11-8952-0018717a8c82&quot; target=&quot;_blank&quot;&gt;Johan Bjornfot&lt;/a&gt; to the rescue. But my problem was not solved.&lt;/p&gt;

&lt;p&gt;In my opinion the routing above should work. If a segment is not defined in the URL but it is defined in the defaults the segment still should be set. This means that in the example above the URL is /welcome/FOOBAR. My defaults are &lt;font face=&quot;Consolas&quot;&gt;home&lt;/font&gt; as node and &lt;font face=&quot;Consolas&quot;&gt;index&lt;/font&gt; as action. When my URL is resolved I think the node and action should be in the RouteData.&lt;/p&gt;

&lt;p&gt;To help you understand I created this code snippet.&lt;/p&gt;

&lt;pre&gt;var a = new RouteData();
a.DataTokens.Add(&amp;quot;node&amp;quot;, &amp;quot;home&amp;quot;);
a.Values.Add(&amp;quot;action&amp;quot;, &amp;quot;index&amp;quot;);
a.Values.Add(&amp;quot;id&amp;quot;, &amp;quot;FOOBAR&amp;quot;);&lt;/pre&gt;

&lt;p&gt;The node should be in the &lt;font face=&quot;Consolas&quot;&gt;DataTokens&lt;/font&gt; because it is not a default routing segment. The action and id should be in the &lt;font face=&quot;Consolas&quot;&gt;Values &lt;/font&gt;&lt;font face=&quot;Arial&quot;&gt;because these are default MVC routing segments. 
    &lt;br /&gt;When this would happen my welcome/FOOBAR URL would be accessible because it is being processed correctly by the &lt;font face=&quot;Consolas&quot;&gt;MultiplexingRouteHandler&lt;/font&gt; which is used by default when you map a route with &lt;font face=&quot;Consolas&quot;&gt;MapContentRoute&lt;/font&gt;. Unfortunately this is not how it works. 

    &lt;br /&gt;Resolving the node happens in the &lt;font face=&quot;Consolas&quot;&gt;GetRoutedData&lt;/font&gt; method of the &lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;MultiplexingRouteHandler&lt;/font&gt;&lt;font face=&quot;Arial&quot;&gt;. When the DataTokens does not contain a &lt;font face=&quot;Consolas&quot;&gt;node&lt;/font&gt; object this line results in a exception.&lt;/font&gt;&lt;/p&gt;

&lt;pre&gt;ContentReference contentLink = RequestContextExtension.GetContentLink(requestContext);&lt;/pre&gt;

&lt;p&gt;The solution I found (and maybe there are better solutions and if so please tell me!) is the following: 
  &lt;br /&gt;I created a class which inherits from &lt;font face=&quot;Consolas&quot;&gt;MultiplexingRouteHandler&lt;/font&gt;. I specifically inherited from this class and not from &lt;font face=&quot;Consolas&quot;&gt;IRouteHandler&lt;/font&gt; because I want everything to be the same as the default routing except for a few things and I did not want to invent the wheel all over again. 

  &lt;br /&gt;This class has a lot of private methods but &lt;font face=&quot;Consolas&quot;&gt;GetHttpHandler&lt;/font&gt; and &lt;font face=&quot;Consolas&quot;&gt;GetRouteHandler&lt;/font&gt; are public. The &lt;font face=&quot;Consolas&quot;&gt;GetRouteHandler&lt;/font&gt; method is the one we want to alter before the URL is resolved.&lt;/p&gt;

&lt;pre&gt;public override IRouteHandler GetRouteHandler(RequestContext requestContext)
{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ContentRoute r = requestContext.RouteData.Route as ContentRoute;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (r == null) return base.GetRouteHandler(requestContext);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; foreach (var i in r.Defaults)&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (i.Key.Equals(RoutingConstants.NodeKey))&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (requestContext.RouteData.DataTokens.ContainsKey(i.Key)) continue;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (i.Value == null || String.IsNullOrWhiteSpace(i.Value.ToString())) continue;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; requestContext.RouteData.DataTokens.Add(i.Key, this.GetPageReference(i.Value.ToString()));&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (i.Key.Equals(RoutingConstants.ActionKey))&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (requestContext.RouteData.Values.ContainsKey(i.Key)) continue;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; requestContext.RouteData.Values.Add(i.Key, i.Value);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return base.GetRouteHandler(requestContext);
}&lt;/pre&gt;

&lt;p&gt;So what does this code do? As you can see, before the &lt;font face=&quot;Consolas&quot;&gt;MultiplexingRouteHandler.GetRouteHandler&lt;/font&gt; default functionality is triggered I am altering the &lt;font face=&quot;Consolas&quot;&gt;RouteData&lt;/font&gt; object in my &lt;font face=&quot;Consolas&quot;&gt;RequestContext&lt;/font&gt; object.&lt;/p&gt;

&lt;p&gt;In my case I just wanted the &lt;font face=&quot;Consolas&quot;&gt;{node}&lt;/font&gt; and &lt;font face=&quot;Consolas&quot;&gt;{action}&lt;/font&gt; to be in my &lt;font face=&quot;Consolas&quot;&gt;RouteData&lt;/font&gt; object (because &lt;font face=&quot;Consolas&quot;&gt;RoutingContants&lt;/font&gt; are not constants I couldn’t use a switch statement). Casting my &lt;font face=&quot;Consolas&quot;&gt;Route&lt;/font&gt; object in &lt;font face=&quot;Consolas&quot;&gt;RequestContext&lt;/font&gt; to a &lt;font face=&quot;Consolas&quot;&gt;ContentRoute&lt;/font&gt; gives me the opportunity to access the &lt;font face=&quot;Consolas&quot;&gt;Defaults&lt;/font&gt; which are defined in my route map.&lt;/p&gt;

&lt;p&gt;&lt;font size=&quot;1&quot;&gt;&lt;strong&gt;Background information 
      &lt;br /&gt;&lt;/strong&gt;MapContentRoute is a extension method in RouteCollectionExtensions. This method adds a ContentRoute object to the RouteCollection.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;If the node key is not defined in my DataTokens, I want to add it. Unfortunately EPiServer requires the node DateToken to be a &lt;font face=&quot;Consolas&quot;&gt;PageReference&lt;/font&gt; and all I got is a string of the wanted node. Therefore I wrote the &lt;font face=&quot;Consolas&quot;&gt;GetPageReference&lt;/font&gt; method (again, this is the way I thought was best but if you have a better solution, please comment).&lt;/p&gt;

&lt;pre&gt;private PageReference GetPageReference(string nodeValue)
{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PageData page = this.contentLoader.GetBySegment(ContentReference.StartPage, nodeValue, ServiceLocator.Current.GetInstance&amp;lt;ILanguageSelector&amp;gt;()) as PageData;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return page == null ? null : page.PageLink;
}&lt;/pre&gt;

&lt;p&gt;This method retrieves all children under the start page and retrieves the first page that has the correct name and returns the PageLink as &lt;font face=&quot;Consolas&quot;&gt;PageReference&lt;/font&gt;.&lt;/p&gt;

&lt;p&gt;The action should be placed in the &lt;font face=&quot;Consolas&quot;&gt;Values&lt;/font&gt; object, if not present, because this is a default MVC route segment. You could alter or extend the implementation of the &lt;font face=&quot;Consolas&quot;&gt;GetRouteHandler&lt;/font&gt; method if needed.&lt;/p&gt;

&lt;p&gt;Now when I add a content route mapping in my &lt;font face=&quot;Consolas&quot;&gt;RouteConfig&lt;/font&gt; I should change my RouteHandler. This can be done via the &lt;font face=&quot;Consolas&quot;&gt;MapContentRouteParamters&lt;/font&gt;.&lt;/p&gt;

&lt;pre&gt;routes.MapContentRoute(&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;welcome_page&amp;quot;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;welcome/{id}&amp;quot;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; new { node = &amp;quot;home&amp;quot;, action = &amp;quot;index&amp;quot; },&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; new MapContentRouteParameters&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RouteHandler = new CustomRouteHandler(&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ServiceLocator.Current.GetInstance&amp;lt;IContentLoader&amp;gt;(),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ServiceLocator.Current.GetInstance&amp;lt;IPermanentLinkMapper&amp;gt;(),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ServiceLocator.Current.GetInstance&amp;lt;TemplateResolver&amp;gt;(),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ServiceLocator.Current.GetInstance&amp;lt;LanguageSelectorFactory&amp;gt;(),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ServiceLocator.Current.GetInstance&amp;lt;IUpdateCurrentLanguage&amp;gt;()&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; )&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
);&lt;/pre&gt;

&lt;p&gt;Now when I enter /welcome/FOOBAR in my browser, the node “home” is being resolved and my “index” action is being hit in my HomePageController.&lt;/p&gt;

&lt;p&gt;Hope this will help someone in the future. If you have some questions or comments about the information above please leave a message.&lt;/p&gt;</id><updated>2014-04-11T09:59:33.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>