title: How to make a common POST method for multiple Submit buttons in a View
body: <p>I have a view which load values and captures user input values. The page has multiple submit type buttons, and each has different purpose. Each button sends values to different sets of tables in the database.
  For e.g.,</p>
  
  <p><a href="https://i.stack.imgur.com/HRGjD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HRGjD.png" alt="enter image description here"></a> </p>
  
  <p><strong>My query is</strong> to make a common form POST method for all the buttons.</p>
  
  <p><strong>My View is like:</strong></p>
  
  <pre><code>@using (Html.BeginForm("CallAllocationSubmit", "Home", FormMethod.Post, new { id = "FrmCallAllocationSubmit", ReturnUrl = ViewBag.ReturnUrl }))
  {
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;button class="btn btn-success btn-icon " type="submit" style="width:100px;" name="Allocate" &gt;Allocate&lt;/button&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;button class="btn btn-primary  btn-icon " type="submit" style="width:100px;" name="Defer" &gt;Defer &lt;/button&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  }
  </code></pre>
  
  <p><strong>My Controller is like :</strong></p>
  
  <pre><code>[HttpPost]
  public ActionResult CallAllocationSubmit(Allocation ObjAllocation, FormCollection frmCollection, string Allocate, string Defer)
  {
      try
      {
          if (!string.IsNullOrEmpty(Allocate))
          {
              // All code goes here
          }
  
          if (!string.IsNullOrEmpty(Defer))
          {
              // All Code goes here  
          }
          return RedirectToAction("CallAllocation");
      }
      //catch block
  }
  </code></pre>
  
  <p>I tried above method using if condition but the buttons ain't working, and not coming to the controller on clicking.
  Please suggest how can I implement this functionality, or provide correction for my view and controller. Thanks!   </p>