title: MVC4: How to control multiple parameters
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2246481/routing-with-multiple-parameters-using-asp-net-mvc">Routing with Multiple Parameters using ASP.NET MVC</a>  </p>
  </blockquote>
  
  
  
  <p>Experimenting with the MVC4 web api, I defined the following route, in Global.asax</p>
  
  <pre><code>routes.MapRoute(
    name:="API Default", 
    url:="api/{systemid}/{controller}/{id}",
    defaults:=New With {.id = RouteParameter.Optional}
  )
  </code></pre>
  
  <p>I changed the controller accordingly</p>
  
  <pre><code>Public Class ValuesController
      Inherits ApiController
  
   Public Function GetValues(systemid As Integer) As IEnumerable(Of String)
       ---
   End Function
  
   Public Function GetValue(systemid As Integer, ByVal id As Integer) As String
       ---
   End Function
  End Class
  </code></pre>
  
  <p>I was looking to format requests uri like</p>
  
  <pre><code>http://localhost/api/13/values/5 
  </code></pre>
  
  <p>but the only working call is with explicit parameters, as to </p>
  
  <pre><code>http://localhost/api/values?id=5&amp;systemid=4
  </code></pre>
  
  <p>Is there a way to accomplish what I was looking for?</p>