title: custom javascript deserializer in c#
body: <p>I am working on a C# application which has a browser integrated with it.
  The browser will send some data to C# in json format.</p>
  
  <p>Some of the fields from json can be dserialized using javascript deserializer, but I have some data for which a custom deserializer is required, I need to register a deserializer for that but the thing is the custom deserializer must be called only for those special data and the default javascript deserializer must be called for other data, the special data can be identified from there target field's data type / name in C#. How can I achieve this.</p>
  
  <p>something like this.</p>
  
  <pre><code>public class example
  {
    public string abc;
    public someOtherDataType xyz;
  
    public void example()
    {
      serializer = new JavaScriptSerializer();
  
      // receive json string
  
          serializer.RegisterConverters(new JavaScriptConverter[]
           { 
      new System.Web.Script.Serialization.CS.CustomConverter() 
      });
  
      //call deserializer
  
  }
  }
  </code></pre>
  
  <p>The json string will be something like </p>
  
  <pre><code>{
  "abc" : "valueabc"
  "xyz" : "valueXYZ"
  }
  </code></pre>
  
  <p>Now the custom deserializer must be called only during deserializing xyz and default must be called for abc.</p>
  
  <p>Thank you.</p>