Returning Json From An Ajax Get Call - Receiving An Undefined Error On All But The First Record In The Json Object
Here's my client side code: $.ajax({ url: 'http://localhost/App.WebAPI/api/Messages/AppName', type: 'GET', dataType: 'json',
Solution 1:
The problem was that I had a foreign key relationship defined in my table (MSSQL) - I am using Entity Framework - and so when the JSON was returned by the WebAPI, the foreign key was included in the JSON, as expected, but for some reason it made the JSON look all funky. I removed all relationships in my table, ran the API call again, and now I am getting all my records back.
But I know that just works around the issue of having foreign keys, which I will investigate further.
Post a Comment for "Returning Json From An Ajax Get Call - Receiving An Undefined Error On All But The First Record In The Json Object"