I have a GET and POST method with the same signature which is giving a compile time error.
[HttpGet]
public ActionResult MyAction(string myString)
{
// do some stuff
return View();
}
[HttpPost]
public ActionResult MyAction(string myOtherString)
{
// do different stuff
return View();
}
So I have to do something with myString in the Get Request but I have to do something else with myOtherString in POST request. Doing some research I have see the following stack overflow answer - post and get with same method signature
Accepted answer was:
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult Friends()
{
// do some stuff
return View();
}
// Post:
[ActionName("Friends")]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Friends_Post()
{
// do some stuff
return View();
}
My question really is - in the accepted answer will a POST Request to "SomeController", "Friends" still result in the Friends_Post action being executed?