我如何创建一个返回JSON格式的数据的ASP.NET web服务?
How do I create an ASP.NET web service that returns JSON formatted data?
要理解的最重要的事情是要知道如何重新present数据以JSON格式。 请参阅 http://www.json.org/ 更多地了解它。
The most important thing to understand is to know how to represent data in JSON format. Please refer http://www.json.org/ to know more about it.
一旦你理解了这一点,那么剩下的部分是pretty的直线前进。
Once you understand this, then the rest part is pretty straight forward.
请检查下面的网址相同的例子。
Please check the following URL for an example of the same.
http://www.ajaxprojects.com/ajax/tutorialdetails.php? itemid的= 264 HTTP://$c$c.msdn.microsoft.com/JSONSampleDotNet http://www.phdcc.com/xml2json.htm
我建议jQuery库这一点。这是它支持调用Web服务的轻量级丰富的库,处理JSON数据格式输出等等。
I recommend Jquery library for this. It's a lightweight rich library which supports calling web services, handle json data format output etc.
请参阅www.jquery.com获取更多信息。
Refer www.jquery.com for more info.