Serialization and deserialization

Source: Internet
Author: User

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.