-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.

user99322
  • 1,157
  • 2
  • 15
  • 26
  • Please include your client code as well so that we may offer a working solution. A common problem is sending an object that has a property that is the array you want rather than just the array. – Bernhard Hofmann Feb 14 '13 at 08:17

1 Answers1

0

Take a look at this question:

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.

Community
  • 1
  • 1
Dave Swersky
  • 34,502
  • 9
  • 78
  • 118