Serializes a given Object and writes the resulting JavaScript Object Notation (JSON) string to the specified StringBuilder.
Syntax
CSharp
VisualBasic
ManagedCPlusPlus
JSharp
Parameters
- obj (Object)
The Object to serialize.
- output (StringBuilder)
The StringBuilder used to write the JSON string.
Remarks
When the JavaScriptSerializer instance is serializing a type for which it has a custom converter registered, the serializer calls the Serialize(Object, JavaScriptSerializer) method to obtain the dictionary of name/value pairs which will be converted to a JSON string.
The Serialize method can also throw exceptions if the object graph is too complex or if registered instances of JavaScriptConverter have incorrectly caused converter recursion.
Exceptions
Assembly: System.Web.Extensions (Module: System.Web.Extensions)