Just ran into an odd error, but unfortunately I cannot access my asp.net forums account to ask.
In a controller, where I was testing one-shot responses, I get an action ambiguity error.
[HttpGet]
public ActionResult MakePreferred(Guid id)
{
var customer = customerRepository.GetById(id);
customer.MakePreferred();
customerRepository.Update(customer);
return RedirectToAction("details", new { id = id });
}
[HttpGet]
public ActionResult MakeNotPreferred(Guid id)
{
var customer = customerRepository.GetById(id);
customer.MakeNotPreferred();
customerRepository.Update(customer);
return RedirectToAction("details", new { id = id });
}
The actions are one-shot formless updates, that refer back to the page the link is actually on. The links are built thusly:
@if (Model.IsPreferred)
{
@Html.ActionLink("Revoke Preferred Status", "MakeNotPreferred", new { id = Model.Id })
}
else
{
@Html.ActionLink("Grant Preferred Status", "MakePreferred", new { id = Model.Id })
}
As you can see, the action names are completely different, as well as the links, so why am I getting ambiguity errors?