Serialization data is a JSONP remote request.

Source: Internet
Author: User

Insus. NET a few days ago, there was a piece of code, "using JSONP cross-origin request data" http://www.cnblogs.com/insus/p/3512271.html is using jQuery DataType's jsonp to get remote data. However, netizens told Insus. NET privately that they would not use it. It mainly refers to the data provided by the remote end and a complete instance demonstration.
In the actual environment developed by Insus. NET, a code gun is used to scan the product that generates the process. First, full scanning is performed within the scanner, and then collected at a specific time (the purchased scanner is not transmitted to the computer in real time. The data collected to the computer is as follows, which is different from the actual situation. Some fields have been omitted:


After obtaining the data, Insus. NET thinking of the way is to use jQuery to get the data, so the code block "use JSONP cross origin request data" http://www.cnblogs.com/insus/p/3512271.html in the new site, first get the data, stored in DataTable, convert it to a json string and pass it to JQuery.
The following shows a data table:


Write another method to serialize the able into a json string:
First, you must reference the namespace using System. Web. Script. Serialization;


Create An aspx webpage and generate the callback function to call jQuery in the page_Load event of aspx. cs:



Next, you can use this method "use JSONP cross-origin request data" http://www.cnblogs.com/insus/p/3512271.html to get the data.
It should not be difficult. If you have any questions, you can continue to discuss them ......

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.