If you look at the View Delete.aspx
you'll see the following html...
<h2>
Delete Confirmation
</h2>
<div>
<p>Please confirm you want to cancel the dinner titled:
<i> <%:Model.Title %>? </i> </p>
</div>
<% using (Html.BeginForm()) { %>
<input name="confirmButton" type="submit" value="Delete" />
<% } %>
As you can see the confirmButton is located here and the value will be passed to the ActionResult you specified.
You can also specify two buttons like...
<% using (Html.BeginForm()) { %>
<input name="confirmButton" type="submit" value="Delete" />
<input name="confirmButton" type="submit" value="Something Else" />
<% } %>
The confirmButton
parameter will have the value of whichever one you clicked...
Why it isn't working properly for you in NerdDinner is strange though but you can easily test this by creating a quick project and opening the default HomeController and adding
[HttpPost]
public ActionResult Index(string confirmButton) {
return View();
}
In the Index.aspx you can add
<% using (Html.BeginForm()) { %>
<input name="confirmButton" type="submit" value="Delete" />
<input name="confirmButton" type="submit" value="Something Else" />
<% } %>
And you should be good to go.