views:

91

answers:

1

Hi

I have an action method that takes in two different objects.

I am posting JSON to the action using jquery, to do this I put all the properties i want to map to my two objects in the one Json object. This works correctly and maps to the two objects in my action!

I want to be able to pass Json and map to a list of objects? is this possible in asp .net MVC?

Thanks

UPDATE: Looks like ActionFilters are the way to go here! found this post.

+1  A: 

I think you should map to an object[] instead of a List<object>. This should map when adding an array of JSON objects as argument to your function.

Jan Jongboom
Thanks! got it working passing an array of single values in Json! when passing a objects within json, its maps the objects as their string representation, strange!
Rigobert Song