Hi, I have created a client side array of javascript objects that I'd like to post back to the server. But when I do the following the array is coming back as 'undefined' Serverside in the FormCollection.
I'm using jQuery and here is my javascript code:
function MyObject(){
this.Param1;
this.Param2;
}
var myArray = new Array();
var newObject1 = new MyObject();
newObject1.Param1 = "abc";
newObject1.Param2 = "efg";
myArray.push(newObject1);
var myArray = new Array();
var newObject2 = new MyObject();
newObject2.Param1 = "hij";
newObject2.Param2 = "klm";
myArray.push(newObject2);
$.post("Save", myArray, function (result) { PostDataCallBack(result); });
Does anyone have an example of something like this or any ideas on how to serialize javascript objects and post them?
Thanks :)