title: Determining which submit button was used to POST a form in asp.net MVC
body: <p>I have a view in asp.net MVC that has two submit buttons.  I would like to know which button was pressed.  The buttons work GREAT so there is no issue there, I just need to do slightly different things depending on which button.  I have checked the Request.Form[] collection and that doesn't contain anything.</p>
  
  <p>Here is my view code....</p>
  
  <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;Data.TempPerson&gt;" %&gt;
  &lt;div class="phonePerson"&gt;
      &lt;% using (Ajax.BeginForm("Create", new AjaxOptions
         {
             UpdateTargetId = "divList",
             HttpMethod = "Post",
             OnSuccess = "RedoLayout"
         }))
         { %&gt;
      &lt;label for="Name"&gt;
          Name:&lt;/label&gt;
      &lt;%= Html.TextBox("Name")%&gt;
      &lt;input type="submit" name="Button" id="Save" value="Save" class="btnSave" /&gt;
      &lt;div id="phoneList" class="phoneList"&gt;
          &lt;table&gt;
              &lt;% foreach (var item in Model.Phones)
                 { %&gt;
                   ... Stuff omitted for space ....
              &lt;% } %&gt;
              &lt;tr&gt;
                  &lt;td colspan="2"&gt;
                      &lt;input type="submit" id="Add" name="Button" value="Add another phone" class="btn_AddPhone" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;% } %&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>