I have a object like:
var my_component = {};
Later I assign some properties to it.
my_component.ID = 1;
my_component.Name = 'test_user';
There are large numbers of object like this.
How can i pass this as a parameter to JSONP Enabled WebService.
I only know i can pass the string, or bool but i want to pass the object and/or object arrays.
Do i need to class of same type but how on the server side.
I am using WCF services for the same.
Do i need to create DATA contracts that will be the parameters
Any help is appreciated.
Turn your object into a JSON string using
JSON.stringify(my_component). For compatibility with IE, you can include json2.js.On server side i need to use the class to convert a string back to array
Here obj is the name of the object.