title: Posting form to different MVC post action depending on the clicked submit button
body: <p>I am using <code>ASP.Net MVC 4</code>. I have multiple buttons on a view.. At present I am calling the same action method; and I am distinguishing the clicked button using a <code>name</code> attribute. </p>
  
  <pre><code>@using (Html.BeginForm("Submit", "SearchDisplay", new { id = Model == null ? Guid.NewGuid().ToString() : Model.SavedSearch }, FormMethod.Post))
  {
      &lt;div class="leftSideDiv"&gt;
          &lt;input type="submit" id="btnExport" class="exporttoexcelButton" 
          name="Command" value="Export to Excel" /&gt;
      &lt;/div&gt;
  
      &lt;div class="pageWrapperForSearchSubmit"&gt;
          &lt;input type="submit" class="submitButton" 
           value="Submit" id="btnSubmitChange" /&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>//ACTION</p>
  
  <pre><code>    [HttpPost]
      public ActionResult Submit(SearchCostPage searchModel, string Command)
      {
          SessionHelper.ProjectCase = searchModel.ProjectCaseNumber;
  
          if (string.Equals(Command, Constants.SearchPage.ExportToExcel))
          {
  
          }
     }
  </code></pre>
  
  <p><strong>QUESTIONS</strong></p>
  
  <ol>
  <li>Is there a way to direct to different POST action methods on different button clicks (without custom routing)?</li>
  <li>If there is no way without custom routing, how can we do it with custom routing?</li>
  </ol>
  
  <p><strong>References:</strong></p>
  
  <ol>
  <li><a href="http://lostechies.com/jimmybogard/2011/06/22/cleaning-up-posts-in-asp-net-mvc/">Jimmy Bogard  - Cleaning up POSTs in ASP.NET MVC</a></li>
  </ol>