Thursday, February 25, 2010

JavaScript Object Notation (JSON)

JavaScript Object Notation (JSON)
To allow for a more efficient transfer of data and classes between web applications and
web services, ASP.NET AJAX supports the JavaScript Object Notation (JSON) format. It is
lighter weight than XML (Extensible Markup Language)/SOAP (Simple Object Access
Protocol), and delivers a more consistent experience because of the implementation
differences of XML/SOAP by the various browsers.
JSON is a text-based data-interchange format that represents data as a set of ordered
name/value pairs. As an example, take a look at the following class definition, which
stores a person’s name and age:

public class MyDetails
{
string FirstName;
string LastName;
int Age;

}

A two-element array of this object is represented as follows:
{ MyDetails : [ { “FirstName” : “Landon”, “LastName” : “Donovan”, “Age” : “22”}
{ “FirstName” : “John”, “LastName” : “Grieb”, “Age” : “46”}
]
}

1 comment:

  1. This is to good, thanks for sharing your knowledge with us. Following links also helped me and develpers.

    http://msdn.microsoft.com/en-us/library/bb299886.aspx

    http://www.mindstick.com/Articles/af150297-b1e0-4316-958e-5a0b11a4a016/?JavaScript%20Object%20Notation%20JSON%20in%20JavaScript%20and%20Net

    ReplyDelete

 
Locations of visitors to this page