Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
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.

share|improve this question
    
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 8:17

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.