title: Enable web api attribute routing in global.asax
body: <p>I'd like to enable Attribute Routing for Web API as it looks like it will make routing easier to define.  The example here: <a href="http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2" rel="noreferrer">http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2</a> shows how it is done in the WebApiConfig.cs file:</p>
  
  <pre><code>using System.Web.Http;
  
  namespace WebApplication
  {
      public static class WebApiConfig
      {
          public static void Register(HttpConfiguration config)
          {
              // Web API routes
              config.MapHttpAttributeRoutes();
  
              // Other Web API configuration not shown.
          }
      }
  }
  </code></pre>
  
  <p>However, my project is an old web forms project, originally started in .Net 2.0 (it's now 4.5 following several upgrades over the years).  I don't have a WebApiConfig.cs file and instead my current routes are defined directly in the global.asax Application_Start method using:</p>
  
  <pre><code>RouteTable.Routes.MapHttpRoute(...)
  </code></pre>
  
  <p>Can anyone explain the best way to enable attribute based routing in this situation?
  Thanks</p>