MVC Ajax.ActionLink nicht finden POST-Methode

Habe ich eine POST-deklarierte Methode in meinem controller:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UpdateComments(int id, string comments)
{
    //... 
}

und einen ActionLink in meiner Ansicht:

<%= Ajax.ActionLink("update", "UpdateComments", 
                        new { id = Model.Id, comments = "test" }, 
                        new AjaxOptions { 
                                HttpMethod="POST", 
                                OnFailure="alert('fail');", 
                                OnSuccess = "alert('success');" 
                            })%>

Bekomme ich ein "not found" Fehler, wenn er versucht zu route mit dieser Anfrage.

Wenn ich entfernen Sie die POST-Einschränkung aus der UpdateComments Methode im controller, es funktioniert gut.

Was bin ich?

InformationsquelleAutor der Frage fearofawhackplanet | 2010-06-14

Schreibe einen Kommentar