Error 500 when calling ajax to controller - MVC Razor

My controller:

    public ActionResult canEdit(List<string> mylist)
        if (SomeProgramLogic)
            return Content("Y");

        return Content("N");


My ajax call:

    var getData = { mylist : myArray}; // An array created in the client side

        type: "GET",
        url: "canEdit",
        data: getData,
        success: function (data) {
        dataType: "json",
        traditional: true


The debugger goes into my controller. mylist contains exact data. Under no circumstances do I see an error or an exception. But I get this error: "Failed to load resource: the server responded with a status of 500 (Internal Server Error) and no warning appears.

My display url format




source to share

1 answer

I changed the value of the returned controller to

     return Json("N", JsonRequestBehavior.AllowGet); 


and that solved the problem. Thanks to @TrueBlueAussie for the pointer.



All Articles