title: Language in URL, Routing and Areas
body: <p>I've learned so far how to set up a correct routing if I would like to have the language within the URL, e.g. <code>.../en/MyController/MyMethod</code>. With the following routing this works great so far:</p>
  
  <pre><code>        routes.MapRoute("Default with language", "{lang}/{controller}/{action}/{id}",     
          new
          {
              controller = "Report",
              action = "Index",
              id = UrlParameter.Optional,
          }, new { lang = "de|en" });
          // Standard-Routing
          routes.MapRoute("Default", "{controller}/{action}/{id}", new
          {
              controller = "Report",
              action = "Index",
              id = UrlParameter.Optional,
              lang = "de",
          });
  </code></pre>
  
  <p>Now I Inserted a new area <code>Cms</code>, and I call <code>AreaRegistration.RegisterAllAreas();</code> in Application_Start().</p>
  
  <p>As soon as I call a controller within this area, I miss the language-key:</p>
  
  <pre><code>        MvcHandler handler = Context.Handler as MvcHandler;
          if (handler == null)
              return;
  
          string lang = handler.RequestContext.RouteData.Values["lang"] as string;
  </code></pre>
  
  <p>How could I make the above routing work with areas?</p>
  
  <p>Thx for any tipps, sl3dg3</p>