0

I'm currently serializing objects like this:

public static string ObjToJson(List<MyObject> TheObjects){

  JavascriptSerializer TheSerializer = new JavascriptSerializer();
  TheSerializer.RegisterConverters( new JavascriptConverter [] { new ObjectToJson() });
  string JsonObj = TheSerializer.Serialize(TheObjects);
  return JsonObj; }

And then I have this:

public class TheObjToJson : JavascriptConverter{
 public override IDictionary<string,object> Serialize (object obj, JavascriptSerializer serializer)
    {
    ...
     return jsonstring;
    }
}

Is this the fastest/best way to do JSON in ASP.NET?

1
  • how about dynamically creating json string and render it. Commented Jun 4, 2011 at 18:50

1 Answer 1

1

I think the most popular JSON library is json.net. It's fast and easy to use.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.