What are some key issues when working with Json answers?

I am working on an ASP.Net MVC project and have been studying a few small tricks with JSON objects that made me stroke my head for quite some time. For example, ensuring that when I call $ .getJSON () from jQuery, I really need to make sure my JSON returns an object, not just a string value (well, D'uh! Right?).

What are some key points to consider when working with JSON objects and answers in your experience? I am particularly interested in ASP.Net, but can be any language.

+5
source share
2 answers

json, , , .Net WCF JSon . JSon -, .

, . JSon, , , , - , , . .

, , . .

:

[DataMember(Order = 1)] //<-- thank Zod this exists!
public List<Foo> MyFoos { get; set; }

"MyFoos" JSon.

. , , - .

+3

. - . .NET Json, , , .

, / , , .trim()!

+1

All Articles