ASP.NET MVC 2.0 JsonRequestBehavior Global Setting

前端 未结 6 929
轻奢々
轻奢々 2021-02-02 06:50

ASP.NET MVC 2.0 will now, by default, throw an exception when an action attempts to return JSON in response to a GET request. I know this can be overridden on a method by method

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-02 07:47

    Just change JSON code from :

    $.getJson("methodname/" + ID, null, function (data, textStatus)
    

    to:

    $.post("methodname/" + ID, null, function (data, textStatus)
    

提交回复
热议问题