I am using the jQuery getJSON function to return JsonResult from my controller page.
Here is the jQuery code on the web page:
$.getJSON("/Test/GetJsonWFA", null, function (data) { $(data).each(function () { alert("call succeeded");
And here is the controller code:
public JsonResult GetJsonWFA() { List<WorkFlowAssignment> listWFAs = new List<WorkFlowAssignment>(); listWFAs.Add(new WorkFlowAssignment() { ID = 1, WorkFlowName = "WorkFlowName1" }); listWFAs.Add(new WorkFlowAssignment() { ID = 2, WorkFlowName = "WorkFlowName2" }); return Json(listWFAs, JsonRequestBehavior.AllowGet); }
I get the following error: Internal server error .
If you replace WorkFlowAssignment on GetJsonWFA with a trivial class, everything will work.
It seems to be related to the type of object in the list.
The WorkFlowAssignment class has many properties and methods.
Can someone point me in the right direction?
source share