Is there some easy way to handle multiple submit buttons from the same form? For example:
<% Html.BeginForm("MyAction", "MyController", FormMethod.Post); %>
<input type="submit" value="Send" />
<input type="submit" value="Cancel" />
<% Html.EndForm(); %>
Any idea how to do this in ASP.NET Framework Beta? All examples I've googled for have single buttons in them.
Best Solution
Here is a mostly clean attribute-based solution to the multiple submit button issue based heavily on the post and comments from Maarten Balliauw.
razor:
and controller:
Update: Razor pages looks to provide the same functionality out of the box. For new development, it may be preferable.