I would like to pass a nested JavaScript object to my ASP.NET MVC Action Method. Here is the code(simplified):
$.getJSON('some/url',
{
index: pageIndex,
pageSize: pageSize,
filter:{one:'one',two:'two',three:'three'}
},someCallBack(msg)
);
I'm using jQuery and implemented my plugin which lazily fetches paginated data from the server. It works all charm but now I need to pass a JavaScript 'Filter' object with variable number of properties-filters. On the server side I get an object array where first item is a string, containing the '[Object object]' literal.
Obviously, my nested object (filter) is not being expanded and transformed into object(hash) on the server side. Is this possible at all?? I don't wan't to hard code my filters, since the plugin is meant to be unversally applied.
Thank you very much.