title: Deserializing JSON objects as List<type> not working with asmx service
body: <p>I am having trouble deserializing my JSON string.  I have a class of type <code>person</code> with public properties for sequence number of type int, first name, and last name.  I want to pass an array of these objects in JSON format and have them deserialized as a list so I can loop through them on the server, but ASP.NET says something about not being supported to be deserialized as an array.  I have validated the JSON I am producing, and it is valid.  Is there something special about the JSON that ASP.NET needs to have before it can deserialize?  The funny thing is if I serialize a list&lt;person&gt; object to JSON it looks exactly like the JSON I am producing.  I must be missing something...  To clarify, I'm using the ASP.NET Ajax library to deserialize.  This is what I get back from the web service:</p>
  <blockquote>
  <p>{&quot;Message&quot;:&quot;Type \u0027System.Collections.Generic.IDictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]\u0027 is not supported for deserialization of an array.&quot;</p>
  </blockquote>
  <p>Actually unfortunately this doesn't seem to have anything to do with deserializing, it appears that you can't pass an array of JSON objects to an asmx web service.  Am I correct?  If you can't do that, is it possible to pass a collection of JSON objects to a web service and have them processed on the server with ASP.NET and C#?</p>
  <h3>Update:</h3>
  <p>OK, here is my code. Here is the person class:</p>
  <pre><code>public class person
  {
      public person()
      {
          //
          // TODO: Add constructor logic here
          //
      }
  
      public int seq
      {
          get;
          set;
       }
  
      public string firstName
      {
          get;
          set;
       }
       public string lastName
       {
          get;
          set;
       }
  
  }  
  </code></pre>
  <p>And here is my JSON string:</p>
  <pre><code>[{&quot;seq&quot;:1,&quot;firstName&quot;:&quot;Chris&quot;,&quot;lastName&quot;:&quot;Westbrook&quot;},
  {&quot;seq&quot;:2,&quot;firstName&quot;:&quot;sayyl&quot;,&quot;lastName&quot;:&quot;westbrook&quot;}]  
  </code></pre>
  <p>And here is the code I'm using</p>
  <pre><code>    [WebMethod]
      public void updatePeople(string json)
      {
          IList&lt;person&gt; people = 
           new JavaScriptSerializer().Deserialize&lt;IList&lt;person&gt;&gt;(json);
  
          //do stuff...
      }
  </code></pre>