title: ASP.NET MVC controller actions with custom parameter conversion?
body: <p>I want to set up a ASP.NET MVC route that looks like:</p>
  
  <pre><code>routes.MapRoute(
    "Default", // Route name
    "{controller}/{action}/{idl}", // URL with parameters
    new { controller = "Home", action = "Index", idl = UrlParameter.Optional } // Parameter defaults
  );
  </code></pre>
  
  <p>That routes requests that look like this...</p>
  
  <pre><code>Example/GetItems/1,2,3
  </code></pre>
  
  <p>...to my controller action:</p>
  
  <pre><code>public class ExampleController : Controller
  {
      public ActionResult GetItems(List&lt;int&gt; id_list)
      {
          return View();
      }
  }
  </code></pre>
  
  <p>The question is, what do I set up to transform the <code>idl</code> url parameter from a <code>string</code> into <code>List&lt;int&gt;</code> and call the appropriate controller action?</p>
  
  <p>I have seen a <a href="https://stackoverflow.com/questions/2570490/asp-net-mvc-controller-parameter-processing">related question here</a> that used <code>OnActionExecuting</code> to preprocess a string, but did not change the type. I don't think that will work for me here, because when I override <code>OnActionExecuting</code> in my controller and inspect the <code>ActionExecutingContext</code> parameter, I see that the <code>ActionParameters</code> dictionary already has an <code>idl</code> key with a null value- presumably, an attempted cast from string to <code>List&lt;int&gt;</code>... this is the part of the routing I want to be in control of.</p>
  
  <p>Is this possible?</p>