title: How to extend or override BeginForm to include a AntiForgeryToken field
body: <p>I was reading this article (<a href="http://weblogs.asp.net/dixin/archive/2010/05/22/anti-forgery-request-recipes-for-asp-net-mvc-and-ajax.aspx" rel="noreferrer">http://weblogs.asp.net/dixin/archive/2010/05/22/anti-forgery-request-recipes-for-asp-net-mvc-and-ajax.aspx</a>) about how to prevent CSRF attacks.  It seems like the solution is to create a tag inside each form.</p>
  
  <pre><code>&lt;%: this.Html.AntiForgeryToken(Constants.AntiForgeryTokenSalt)%&gt;
  </code></pre>
  
  <p>However, I really don't want to copy and paste that code inside of each form.  I would like to extend or override the BeginForm to create a BeginSecureForm that automatically adds the AntiForgeryToken.  I am not sure how to add content inbetween of the BeginForm and EndForm.</p>
  
  <p>Any ideas?</p>