here is an example of the JSON string:
[{"Description":"Administrators can do everything on the site","Id":"381ede0e-3bc1-4d71-83d8-bbb62a3b8aaa","Name":"Admin"},{"Description":"Technical users with limited permissions a","Id":"7a632af6-214b-4a8e-a3f8-9c0aafae2645","Name":"Technical"}]
here is my script so far:
//Get Users Roles:
$.getJSON('@Url.Action("GetAUsersRegisteredRoles")' + '/' + selectedUser, function (json) {
console.log('1:');
console.log(json);
//Parse JSON
$.each(json, function () {
$.each(this, function (k, v) {
alert(v.Id + v.Name +v.Description);
})
});
});
I know I am doing something wrong with the way that I am parsing it? Im sure its just something silly.
Here is the view of the json array in the console:
When I run it in the browser my alert popup comes 6 times and says NaN
I looked at: Link which helped me get to where I am now.