Hello.
I have a view in asp.net MVC that has two submit buttons. I would like to know which button was pressed. The buttons work GREAT so there is no issue there, I just need to do slightly different things depending on which button. I have checked the Request.Form[] collection and that doesn't contain anything.
Here is my view code....
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Data.TempPerson>" %>
<div class="phonePerson">
<% using (Ajax.BeginForm("Create", new AjaxOptions
{
UpdateTargetId = "divList",
HttpMethod = "Post",
OnSuccess = "RedoLayout"
}))
{ %>
<label for="Name">
Name:</label>
<%= Html.TextBox("Name")%>
<input type="submit" name="Button" id="Save" value="Save" class="btnSave" />
<div id="phoneList" class="phoneList">
<table>
<% foreach (var item in Model.Phones)
{ %>
... Stuff omitted for space ....
<% } %>
<tr>
<td colspan="2">
<input type="submit" id="Add" name="Button" value="Add another phone" class="btn_AddPhone" />
</td>
</tr>
</table>
<% } %>
</div>
</div>