Serialization and deserialization
Serialization Serialize and deserialization Deserialize are frequently used in the development process. To enhance the training, Insus. NET makes another demonstration. The environment is implemented in ASP. net mvc.
I practiced it once a long time ago, but it has limitations and cannot be expanded. Http://www.cnblogs.com/insus/p/3699057.html of "C # For generic List <T> serialization and anti-serialization"
Insus. NET writes these two processes as an extension method:
Now, we have prepared a Model. We will use the example of a netizen on the two-day forum to complete it:
Create an Entity class:
In the controller, create three Action operations: View, json string, and json object:
OK. Next, you can create a view, and then display the actions marked 2 and marked 3 in:
First, write jQuery to obtain the json string:
First, let's demonstrate:
Let's take a look at another operation:
Demo: bind the obtained data to the table:
Implement data display. The contentType type is consistent with the type of the server reverse return.
In the following articles, the toJson method is also mentioned. You can refer to it for review and improvement:
Serialization (Serialization) data is JSONP remote request http://www.cnblogs.com/insus/p/3515904.html
How to control the same function as replication in MVC applications http://www.cnblogs.com/insus/p/3549557.html
JQuery's http://www.cnblogs.com/insus/p/3713459.html for retrieving JSON data from general processing programs (ashx)
ASP. net mvc view output json http://www.cnblogs.com/insus/p/3961893.html