Anyone know if it is possible to post a single form with multiple buttons and each button post to a different controller action in Sitecore? On my scenario I have a controller which has 3 actions:
1- load of the page
2- httppost from button A
3- httppost from button B
I'm using an using (Html.BeginForm()) to declare my form and I'm declaring the buttons like this:
<button type="Submit" id="btn" formaction="MyFormActionA" formmethod="POST" class="btn btn-large">
<button type="Submit" id="btn" formaction="MyFormActionB" formmethod="POST" class="btn btn-large">
The problem with this approach is that it posts to a different url and doesn't really work. I know that there are ways around that by setting the form action using javascript and things like that. What I'm wondering is whether it is possible to achieve that using this approach or a similar approach where one can post to different actions withing the same form. As far as I understand it is possible to do this with ASP.NET MVC but not sure on Sitecore.