title: When should I use JSON serialization and why?
body: <p>I am a little confused about when do I have to serialize objects using JSON serialization and when it is not necessary (even needless).</p>
  
  <p>I've spent several days trying to send a list of simple objects using jQuery.ajax and JSON.
  I have a class named Product:</p>
  
  <pre><code>public class Product
  {
      public string Name;
      public string Qnt;
      public string Price;
  }
  </code></pre>
  
  <p>and a web method that returns a list filled with Products</p>
  
  <pre><code>List&lt;Product&gt; p = new List&lt;Product&gt;();
  </code></pre>
  
  <p>I used <code>System.Web.Script.Serialization.JavaScriptSerializer</code> to serialize this list in JSON and send it to the client as a string, where i format it using jQuery</p>
  
  <pre><code>$.each(msg.d, function (index, Product) {
      $('#details').append('&lt;p&gt;Name: ' + Product.Name 
                             + '&lt;br /&gt;Quantity: ' + Product.Qnt 
                             + '&lt;br /&gt;Price: ' + Product.Price + '&lt;/p&gt;');
  });
  </code></pre>
  
  <p>...and it wouldn't work... Because at the client side, I just get a long string (it would be parsed character by character, when I use $.each) <strong>- I learned that it should be parsed first</strong></p>
  
  <p>It took time until I realised that I just have to return it as a List of Product objects, without serialization, <strong>and client gets list of products in perfect JSON format!</strong></p>
  
  <p><strong>EDIT</strong>: 
  What I actually don't understand: if I serialize my list, it returns JSON formated string that have to be parsed before I can use it. If i don't serialize my list, it returns the same data, but as an object, not a string, so I can use it right away. <strong>How can I know do I have to use JSON serialization on my data, or it will always be done by framework</strong>?</p>