Need a second pair of eyes

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?

I’ve seen the exact same thing as you, they are different. What about the rest of your code for this task?

SerenaRules, then you figure out what the problem was?

Not really, thought it’s fixed now. All I did was rename them Foo and Bar, then renamed them back. It started working after that. Very odd. It’s beats all I’ve ever seen.

You are using a GET request… and the browser is caching the first response!
Just a thought…

Disable browser caching (in the browser) and see if the problem persists

You might be right, but it’s never happened before. The thing is, with different names, it’s no different than having the get attribute on Index() and Add(). Oh well, moving along.