How to send javascript object`s array to server?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/10350797/deserializing-javascript-object-instance">Deserializing JavaScript object instance</a>  </p>
</blockquote>



<p>I have an array of following constructor objects in javascript :</p>

<pre><code> function MenuViewModel() {
    var self = this;
    var courseOptionObject = {};

    courseOptionObject["Options"] = [];
    self.ShowHide = ko.observable(false);

        self.Id = ko.observable(getId()); 
        self.Name = ko.observable();
        self.CourseName = ko.observable();
        self.Sequence = ko.observable('1');

        courseOptionObject["MenuId"] = self.Id();
        self.CourseOptions = ko.observable(new CourseOptionViewModel(courseOptionObject));                                             

    if (typeof MenuViewModel.saveButtonControll == "undefined") { //static members of class
        MenuViewModel.saveButtonControll = ko.observable(new buttonModel({ Text: "Save &amp; Continue", Disabled: true, Visible: true }));
        MenuViewModel.IsTextEnable = ko.observable(true);
    }

    self.showDeleteIcon = function (data, event) { 
       data.ShowHide(true); 
    };

    //Hide the delete button from the menu ( call at mouseleave form the menu )
    self.hideDeleteIcon = function (data, event) {
        data.ShowHide(false); 
    };

    self.Errors = ko.validation.group(self);
}
</code></pre>

<p>My array is :</p>

<pre><code>var jObectArray = new Array();
for(var i = 0; i &lt; 5; i++)
{
 jObejctArray.push(new MenuViewModel());
}
</code></pre>

<p>I am sending it through ajax :</p>

<pre><code>$.ajax({
   url :'urltoserver',
   type: 'POST',
   data: { array : JSON.stringify(jObectArray) },
   dataType: 'JSON'
 });
</code></pre>

<p>But i am getting an empty array to server. Can anyone please tell me what i am missing ?</p>

<p><strong>EDIT</strong></p>

<p>console.log(jObejctArray) output is ( 2 obejct in the array ) :</p>

<pre><code>[
{"ShowHide":false,"Id":"8c4c470d-2b25-4070-8d3e-e307e9d49107",
"Name":"Menu-1","CourseName":"course-1","Sequence":1,
"CourseOptions":{"MenuId":"8c4c470d-2b25-4070-8d3e-e307e9d49107",
"Options":[],"errors":["Can`t left options list empty","Can`t insert empty value."],
"Errors":["Can`t left options list empty","Can`t insert empty value."]},
"errors":[],"Errors":[]},

{"ShowHide":false,"Id":"3da9cbc0-9db8-4297-8245-351caaec9f08",
 "Name":"Menu-2","CourseName":"course-2","Sequence":"2",
 "CourseOptions":{"MenuId":"3da9cbc0-9db8-4297-8245-351caaec9f08",
 "Options":[],"errors":["Can`t left options list empty","Can`t insert empty value."],
 "Errors":["Can`t left options list empty","Can`t insert empty value."]},
 "errors":[],"Errors":[]}
] 
</code></pre>
