3 Replies - 1192 Views - Last Post: 14 August 2012 - 03:25 AM Rate Topic: -----

#1 HarpreetKC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-August 12

Why Json is used in Asp.net ?

Posted 08 August 2012 - 04:39 AM

Now starting with json in asp.net, how much json is compatible with asp.net?
what is the exact purpose ?
Is This A Good Question/Topic? 0
  • +

Replies To: Why Json is used in Asp.net ?

#2 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: Why Json is used in Asp.net ?

Posted 08 August 2012 - 05:42 AM

JSON is primarily used to transport data from the browser to the server, or from the server to the browser. JSON stands for Javascript Object Notation and is often used to represent data in an object. For instance, if we were trying to pass around a person object the JSON for it might look something like this:

{
   "FirstName":"John",
   "LastName":"Doe",
   "Age":30
}



This would represent a person named John Doe who is age 30.

JSON is most often used with asp.net when working with MVC because you have a lot more control over what is getting sent, both from the browser and the server. You can use JSON in a WebForms applications if you are using web methods or wcf on the server side and you use something like JQuery to send the request from the browser.

EDIT: As for the why... one reason json has gotten popular as a means of moving data around is that it takes fewer bytes of data to represent an object in json than it would in xml. Smaller data size means faster loading. Also json is javascript so it simplifies the parsing of the data on the client side as well.

This post has been edited by Nakor: 08 August 2012 - 07:05 AM

Was This Post Helpful? 1
  • +
  • -

#3 HarpreetKC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-August 12

Re: Why Json is used in Asp.net ?

Posted 09 August 2012 - 02:44 AM

View PostNakor, on 08 August 2012 - 05:42 AM, said:

JSON is primarily used to transport data from the browser to the server, or from the server to the browser. JSON stands for Javascript Object Notation and is often used to represent data in an object. For instance, if we were trying to pass around a person object the JSON for it might look something like this:

{
   "FirstName":"John",
   "LastName":"Doe",
   "Age":30
}



This would represent a person named John Doe who is age 30.

JSON is most often used with asp.net when working with MVC because you have a lot more control over what is getting sent, both from the browser and the server. You can use JSON in a WebForms applications if you are using web methods or wcf on the server side and you use something like JQuery to send the request from the browser.

EDIT: As for the why... one reason json has gotten popular as a means of moving data around is that it takes fewer bytes of data to represent an object in json than it would in xml. Smaller data size means faster loading. Also json is javascript so it simplifies the parsing of the data on the client side as well.


Thanks..... for the reply.

View PostHarpreetKC, on 09 August 2012 - 02:44 AM, said:

View PostNakor, on 08 August 2012 - 05:42 AM, said:

JSON is primarily used to transport data from the browser to the server, or from the server to the browser. JSON stands for Javascript Object Notation and is often used to represent data in an object. For instance, if we were trying to pass around a person object the JSON for it might look something like this:

{
   "FirstName":"John",
   "LastName":"Doe",
   "Age":30
}



This would represent a person named John Doe who is age 30.

JSON is most often used with asp.net when working with MVC because you have a lot more control over what is getting sent, both from the browser and the server. You can use JSON in a WebForms applications if you are using web methods or wcf on the server side and you use something like JQuery to send the request from the browser.

EDIT: As for the why... one reason json has gotten popular as a means of moving data around is that it takes fewer bytes of data to represent an object in json than it would in xml. Smaller data size means faster loading. Also json is javascript so it simplifies the parsing of the data on the client side as well.


Thanks..... for the reply.

Was This Post Helpful? 0
  • +
  • -

#4 annaharris  Icon User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 38
  • Joined: 03-May 12

Re: Why Json is used in Asp.net ?

Posted 14 August 2012 - 03:25 AM

JSON (Javascript Object Notation) is used in an ASP.NET web application, only the browser enjoys Javascript support. ASP.NET provides support for programmatically creating and parsing JSON text. Working with JSON in .NET using “Jayrock” is similar to working with XML through the XmlWriter, XmlReader, and XmlSerializer classes in the .NET Framework. These classes are useful for interfacing with JSON at a low- and stream-oriented level.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1