MVC Ajax.ActionLink doesn't find POST method

前端 未结 4 1275
终归单人心
终归单人心 2021-02-05 16:17

I have a POST method declared in my controller:

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


        
4条回答
  •  清酒与你
    2021-02-05 16:51

    I am learning ASP.MVC at this moment and I had that issue with my Ajax.ActionLink, I got a GET method and not a POST method as it should had been. Then I realize that I didn't add the scripts library reference:

    
    
    

    After I adding the script it worked fine!

提交回复
热议问题