The length of the string exceeds the value set on the maxJsonLength property. in MVC3

后端 未结 2 1470
我寻月下人不归
我寻月下人不归 2021-01-26 15:29

MVC3 (.cshtml File)

$.getJSON(URL, Data, function (data) {

                    document.getElementById(\'divDisplayMap\').innerHTML = data;

                            


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-26 16:30

    Try to update your Controller method as shown below:

    public JsonResult ZoneType_SelectedState(int x_Id, int y_Id)
    {
        var result = Json("LongString", JsonRequestBehavior.AllowGet);
        result.MaxJsonLength = int.MaxValue;
        return result;
    }
    

    Hope this helps...

提交回复
热议问题