title: Execute code on Post request in ASP.NET MVC
body: <p>I'm pretty new to ASP.NET MVC and was wondering how to do the following:</p>
  
  <p>I have a list with some buttons like this:</p>
  
  <pre><code>@model List&lt;SitefinityWebApp.Mvc.Models.ProfileModel&gt;
  
  @using (Html.BeginForm())
  {
     &lt;ul&gt;
        @foreach (var item in Model)
        {
           &lt;li&gt;
              &lt;span&gt;@item.EmailAddress&lt;/span&gt;
              &lt;button id="submit"&gt;Generate code&lt;/button&gt;
          &lt;/li&gt;
        }
     &lt;/ul&gt;
  }
  </code></pre>
  
  <p>So when a user clicks on the button, I need to execute some code on the server where I need the email address as a parameter.</p>
  
  <p>I think I would need a POST for this, but I'm not sure how to set this up. In the end I want the same list to be rendered again.</p>
  
  <p>I tried an ActionLink, but this is only for GET requests as I understood?</p>
  
  <p>Any ideas on how to do this?</p>
  
  <p>Thanks,
  Daniel</p>