I am POSTing data to an MVC controller and I\'m attempting to maintain state as well for optimistic concurrency. I\'m currently posting back a JSON request, but would be op
As far as I know, there is no way to send back two completely different JSON objects that aren't children of a single parent JSON object and have jQuery decode it for you using the .ajax() method. You could, I suppose, reply with two JSON objects as strings and then use an external JSON library to evaluate the strings into a Javascript Object.
Does that answer your question?
Ooops: You're asking about posting two distinct JSON objects to your controller from jquery..., right? My bad... Yeah, you can do that... Just change this line:
data: $.toJSON(data),
to:
data: { json_1:$.toJSON(data_1), json_2:$.toJSON(data_2) },
Sorry about the mix-up.