i have the following form
<form action="ManageLink" method="post">
<input name="artistName" type="text"/>
<input name="songName" type="text"/>
<input name="url" type="text"/>
<input name="action" id="save" type="submit" value="Save"/>
<input name="action" id="delete" type="submit" value="Delete"/>
</form>
with this signature for the action method
public JavaScriptResult ManageLink(string artistName, string songName, string url, string action)
I'm naming the submit buttons so that I can know which one was clicked, and act accordingly.
I'm trying to turn this into an ajax form as shown below
<% using (Ajax.BeginForm("ManageLink", new AjaxOptions()))
{ %>
<input name="artistName" type="text"/>
<input name="songName" type="text"/>
<input name="url" type="text"/>
<input name="action" type="submit" value="Save"/>
<input name="action" type="submit" value="Delete"/>
<% } %>
however i get an error in the MicrosoftAjax.js code.
If i remove the name="action" property then i dont get the error, but then I'm not able to tell which button was clicked.
Is there something I've got wrong in the code above? Or is there a better approach that i can use to detect which button was clicked?