Ho un metodo POST dichiarato nel mio controller:MVC Ajax.ActionLink non trova metodo POST
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UpdateComments(int id, string comments)
{
// ...
}
e un ActionLink a mio avviso:
<%= Ajax.ActionLink("update", "UpdateComments",
new { id = Model.Id, comments = "test" },
new AjaxOptions {
HttpMethod="POST",
OnFailure="alert('fail');",
OnSuccess = "alert('success');"
})%>
ottengo "non trovato "Errore nel tentativo di instradare questa richiesta.
Se rimuovo la restrizione POST dal metodo UpdateComments nel controller, funziona correttamente.
Cosa mi manca?
Questi sono obsoleti in MVC3 e MVC4. Vedi: http://stackoverflow.com/a/8784998/210780 – ashes999