I'm experiencing a weird behaviour, at least to me. I written two methods within a controller with apparently different signatures:
[Route("~/Wallets/{walletId}/Transactions/Add")]
public async Task<ActionResult> Add(long walletId)
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Add(AddTransactionViewModel model)
The thing is every time I try to call the POST method using Ajax.BeginForm the GET method (the first) gets called.
@using (Ajax.BeginForm("Add", "Transactions",
new AjaxOptions() { HttpMethod = "POST" })
{
...
}
Now, why this is happening? Of course if I change the name of the GET method say to AddTransaction the code works, but I want to understand why it doesn't as it is.