1, JS object creation: Because the object JSON needs to be serialized, can be passed to the background, the background based on the JSON string deserialization.
2, the Jquery $.ajax method configuration
The configuration parameters for the $.ajax method need to be modified:
1) DataType: "JSON", Traditional:true: The data type must be JSON. By default, traditional is false, which means that jquery will serialize the parameter object in depth.
But Servelt API cannot handle, we can prevent deep serialization by setting traditional to True
2) This is the point! The JS object needs to be JSON serialized, otherwise it cannot be delivered to the server.
Json.stringify (Textdatainfo)
3, the server side to deserialize:
list<study> list = newtonsoft.json.jsonconvert.deserializeobject<list<study>> (TextDataInfo);
Newtonsoft.Json.JsonConvert is a free Json conversion tool from Microsoft.
Reference the Newtonsoft.Json.dll file in the application.
This allows you to switch directly to the entity in the background.
Front desk:
Background:
You can see the effect:
jquery Ajax passes multiple objects or arrays to the background