title: How to get route name in htmlhelper?
body: <p>I want to get the current route name in my html helper but I don't know how to make it.</p>
  
  <p>I thinks the solution is in this post <a href="https://stackoverflow.com/questions/363211/how-can-i-get-the-route-name-in-controller-in-asp-net-mvc">post</a> but I don't know how to create the RouteCollectionExtions.</p>
  
  <p>For the moment my code is:</p>
  
  <blockquote>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Globalization;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using System.Web.Routing;
  
  public static class RouteCollectionExtensions
      {
          public static Route MapRouteWithName(this RouteCollection routes, string name, string url, object defaults, object constraints)
          {
              Route route = routes.MapRoute(name, url, defaults, constraints);
              route.DataTokens = new RouteValueDictionary();
              route.DataTokens.Add("RouteName", name);
  
              return route;
          }
      }
  
      public class RouteConfig
      {
          public static void RegisterRoutes(RouteCollectionExtensions routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
              routes.IgnoreRoute("favicon.ico");
  
              // Default
              routes.MapRoute ("Default", "", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
              outes.MapRouteWithName("HomeFr", "fr", new { controller = "Home", action = "Index" });
          }
      }
  </code></pre>
  </blockquote>
  
  <p>Do you know why the compiler says:   </p>
  
  <blockquote>
    <p>'MyNamespace.RouteCollectionExtensions' does not contain a definition for 'MapRoute' and the best extension method overload 'System.Web.Mvc.RouteCollection.Extensions.MapRoute(System.web.Routing.RouteCollection, string, string, string[])' has some invalid arguments.</p>
  </blockquote>
  
  <p>Thanks you for your help.
  Regards,</p>