Can someone explain what is json method and it use in .net
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JSON is not .NET specific, it is a form of data transmission. It can be likened to an array of strings. Its main use is to provide a means of returning data from a web service.
Data from a web service (prior to JSON) was predominantly done with XML. But XML is costly to serialise/deserialise because of the complex traversal of the document.
Because of the simple format of JSON, its much faster to serialise/deserialise, not to mention its a smaller piece of data which means its faster over the wire.
None of the above points have anything to do with .NET, they just pertain to JSON in the world of web services.
Now in relation to ASP.NET:
You most likely either have a “classic” web service (ASMX), or a WCF web service, and want to return data from it. Without any extra configuration, youre web service would return XML. But this can be changed to JSON with a few steps (google ‘return json from .net web service). The most common use of this is invoking a webservice with AJAX (and/or jQuery) on an ASP.NET page, in which having your data returned as JSON as opposed to XML will benefit for the above reasons.