Is there some easy way to handle multiple submit buttons from the same form? For example:
<% Html.BeginForm(\"MyAction\", \"MyController\", FormMethod.Pos
This is the technique I'd use and I don't see it here yet. The link (posted by Saajid Ismail ) that inspires this solution is http://weblogs.asp.net/dfindley/archive/2009/05/31/asp-net-mvc-multiple-buttons-in-the-same-form.aspx). It adapts Dylan Beattie's answer to do localization without any problems.
In the View:
<% Html.BeginForm("MyAction", "MyController", FormMethod.Post); %>
<% Html.EndForm(); %>
In the Controller:
public class MyController : Controller
{
public ActionResult MyAction(string button)
{
switch(button)
{
case "send":
this.DoSend();
break;
case "cancel":
this.DoCancel();
break;
}
}
}