title: ASP.NET MVC Using two inputs with Html.BeginForm
body: <p>Is it possible to have two inputs, or button controls, trigger two different actions within the same controller bound to Html.BeginForm?</p>
  
  <p>In the following example, I want the Subscribe input  to call Subscribe action on the controller.  This works well.  I want the Unsubscribe input to call my Unsubscribe action.  How do I make this happen?  TIA.</p>
  
  <pre><code>&lt;% using (Html.BeginForm("Subscribe", "NewsLetter"))
      {%&gt;    
          &lt;div class="editor-field"&gt;
              &lt;%= Html.TextBoxFor(model =&gt; model.EmailAdress) %&gt;
              &lt;%= Html.ValidationMessageFor(
                  model =&gt; model.EmailAdress) %&gt;                                
          &lt;/div&gt;                        
          &lt;div &gt;
              &lt;input type="submit" class="submit" value="Subscribe" /&gt;
              &lt;input type="submit" class="submit" value="Unsubscribe" /&gt;
          &lt;/div&gt;         
  &lt;% } %&gt;
  </code></pre>
  
  <p><strong>Update</strong>:</p>
  
  <p>Just more context to this question:</p>
  
  <p>My NewsLetterController has two actions Subscribe and Unsubscribe as posted below:</p>
  
  <pre><code>public class NewsLetterController : Controller
      {      
          [HttpPost]
          public ActionResult Subscribe(NewsletterSubscriber subscriber)
          {
             // do something
  
          }
  
          [HttpPost]
          public ActionResult Unsubscribe(NewsletterSubscriber subscriber)
          {
              // do something
          }
  </code></pre>
  
  <p>I was hoping that I can invoke each action from the same Form element, but this apparently is false.  How do I still maintain the MVC pattern but avoid scripting if possible?  The posted HTML is part of a partial view rendered on the main page. </p>
  
  <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl
                                     &lt;AkwiMemorial.Models.NewsletterSubscriber&gt;" %&gt;
  
     &lt;h2&gt;&lt;strong&gt;Newsletter&lt;/strong&gt;&lt;/h2&gt;
      &lt;legend&gt;Enter your email&lt;/legend&gt;
  
      &lt;% using (Html.BeginForm("Subscribe", "NewsLetter"))
         {%&gt;    
              &lt;div class="editor-field"&gt;
                  &lt;%= Html.TextBoxFor(model =&gt; model.EmailAdress) %&gt;
                  &lt;%= Html.ValidationMessageFor(model =&gt; model.EmailAdress) %&gt;
              &lt;/div&gt;                        
             &lt;div &gt;
               &lt;input type="submit" class="submit" name="sub" 
                      value="Subscribe" /&gt;
                &lt;input type="submit" class="submit" name="unsub" 
                       value="Unsubscribe" /&gt;
              &lt;/div&gt;         
      &lt;% } %&gt;
  </code></pre>