title: Specifying single method as target for multiple controller URL's
body: <p>There are lots of questions asking about this logic in reverse, however, I can't find an answer for my issue.  I'm new to MVC so might not have the terminology specified correctly.</p>
  
  <p>I have a View containing a form, where a user can request a product.  The same View is used regardless of the product, but specific fields are shown in the form relating to that particular product, e.g.</p>
  
  <pre><code>public class RequestController : Controller
  {
      // This bit works fine and displays the appropriate form in the view
      public ActionResult MyProduct(string id)
      {
          if (string.IsNullOrWhiteSpace(id))
          {
              return new HttpNotFoundResult();
          }
          ProductRequest qd = new ProductRequest();
          switch (id)
          {
              case "Beer":
                  qd.RequestType = Models.RequestType.Beer;
                  break;
              case "Coffee":
                  qd.RequestType = Models.RequestType.Coffee;
                  break;
              case "Soda":
                  qd.RequestType = Models.RequestType.Soda;
                  break;
          }
          return View("Index", qd);
      }
  
      // Need to get all forms rendered by the above to post here...
      [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult MyProduct(ProductRequest qd)
      {
          if (!ModelState.IsValid)
          {
              return View(qd);
          }
          else
          {
              // To do ...
          }
      }
  }
  </code></pre>
  
  <p>When the form is rendered in the view, using...</p>
  
  <pre><code>@using (Html.BeginForm())
  </code></pre>
  
  <p>...the rendered HTML shows a different form target URL for each product type, e.g:</p>
  
  <pre><code>&lt;form action="/Request/MyProduct/Beer" method="post"&gt;
  </code></pre>
  
  <p>Can I make the <code>form action</code> property use the same controller/method regardless of the product type?  e.g.</p>
  
  <pre><code>&lt;form action="/Request/MyProduct" method="post"&gt;
  </code></pre>
  
  <p>I assume there are different ways to achieve this given the flexibility MVC seems to offer, but I'm looking for best practice please as a learning experience.</p>