c# - Returning 2 Json lists and accessing the data? -
i'm returning 2 lists so:
return json(new { firstlist = alllocations, secondlist = openinghours }, jsonrequestbehavior.allowget);
but when try , access data being returned, getting no values
success: function (data) { (index = 0; index < data.length; ++index) { console.log(data[index].firstlist.locationname);
any great
i assume you're trying concatenate 2 different json objects one? if that's case, need deserialize individual objects first, combine them new json object.
return jsonconvert.serializeobject(new [] {jsonconvert.deserializeobject(firstlist), jsonconvert.deserializeobject(secondlist)})
this should point in right direction.
Comments
Post a Comment