title: ASP.NET MVC - POST Action Method with Additional Parameters from URL
body: <p>With ASP.net MVC is it possible to POST a form to a controller action which includes parameters not in the form, but from the URL?</p>
  
  <p>For example</p>
  
  <p>The Action method in GroupController:</p>
  
  <pre><code>    [AcceptVerbs(HttpVerbs.Post)]
      public ActionResult Create(int idOne, int idTwo, Model model)
      { ... }
  </code></pre>
  
  <p>The route:</p>
  
  <pre><code>"{controller}/{action}/{idOne}/{idTwo}"
  </code></pre>
  
  <p>Posted URL:</p>
  
  <pre><code>/Employee/Show/1/42
  </code></pre>
  
  <p>In this example, the form is being posted to a different controller, the model has the correct value, however the other parameters have default values 0.</p>
  
  <p>The behavior I was expecting is that the ModelBinder would see that I have two parameters that match the given route, and assign the current values of 1 and 42 to the parameters in the same same way a GET operation works.</p>
  
  <p>Is this behavior not supported, or am I missing something?</p>
  
  <p><strong>EDIT</strong>:
  To be clear, the form on the <code>Show</code> view for the controller <code>Employee</code> contains a form which is posting to a different controller. We can call it <code>Group</code>.</p>
  
  <p>The form action URL looks like this</p>
  
  <pre><code>/Groups/Create/0/0
  </code></pre>
  
  <p>The form is declared as follows</p>
  
  <pre><code>Html.BeginForm("Create", "Groups")
  </code></pre>
  
  <p>After trying many different overloads for <code>Html.BeginForm</code> I have found that the parameters are only mapped when the form action URL matches the current URL in the browser address bar.</p>
  
  <p>So if i navigate to the URL <code>/Groups/Create/1/42</code> I will have a new form. If I then submit the form, the URL route values are passed to the POST action.</p>