2

Can someone please give some fair idea about how to use JSON?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Ramesh
  • 1,692
  • 2
  • 18
  • 37
  • 3
    can you be more specific? What is your end-goal? – Matt Sep 23 '09 at 12:49
  • There are a lot of question on stackoverflow on this, see: http://stackoverflow.com/questions/158818/create-json-with-net http://stackoverflow.com/search?q=datacontractserializer – Cleiton Sep 23 '09 at 13:07

4 Answers4

3

Since there are no specifics, the best I can do is point you to a fairly complete how-to using .NET 3.5 to serialize an Object to JSON:

.NET 3.5: JSON Serialization using the DataContractJsonSerializer

Justin Niessner
  • 242,243
  • 40
  • 408
  • 536
2

I use JSON.NET (http://www.codeplex.com/Json) and I think it's a good library. The serialization is almost immediate:

string json = JsonConvert.SerializeObject(obj);

and vice versa:

JObject o = JObject.Parse(json);
Alfre2
  • 2,039
  • 3
  • 19
  • 22
1

Rick Strahl has written several excellent blog posts on the subject.

Try this post for starters: http://www.west-wind.com/weblog/posts/164419.aspx

Paul Suart
  • 6,505
  • 7
  • 44
  • 65
0

Heres a Sample of using JSON in ASP.NET.

James
  • 80,725
  • 18
  • 167
  • 237