views:

46

answers:

1
public Class Object1 {
   int property1
   string property2
   datatime property3
} 

// post method
public virtual void ControllerAction1(Object1[] listOfObjects){

}

I am tryign to pass an array of type object1 to the controller method. The client side sends the array in json format. But parameter listOfObjects is null.

A: 

Take a look at this question:

http://stackoverflow.com/questions/560575/asp-net-mvc-how-to-pass-json-object-from-view-to-controller-as-parameter

You have to use an ObjectFilter to post JSON into an ASP.NET MVC controller action. This technique should allow you to post in an array of JSON-formatted objects.

Dave Swersky