<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Json.NET: Library to help with .NET &#8211; JS communication</title>
	<atom:link href="http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Dan</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-255092</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 06 Sep 2007 17:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-255092</guid>
		<description>One last try at posting this code:

Unfortunately the documentation for the Json.Net library is incredibly lacking. After trying out about a billion different things, I&#039;ve finally figured out how to Deserialize a JavaScript Array of Object Literals in JSON format into something usable on the .Net side.


1. Create a custom class which describes the Object Literals that you&#039;ll be passing in:


&lt;code&gt;
/// Used for deserializing JSON objects from JavaScript
public class JsonSeat {
	/// The seat ID (SeatNo)
	public int id;
	/// Name of the Price Type
	public string priceType;
	/// Number of the Price Type
	public int priceTypeID;
	/// Price of the ticket
	public string price;
	/// Name of the seating section
	public string section;
	/// The Row and Number of the seat
	public string rowAndNumber;
	/// The HyperLink.ClientID of the seat &lt;a&gt; element
	public string anchorID;
}
&lt;/code&gt;


2. Deserialize your JSON string into a List of your custom classes:


&lt;code&gt;
List&lt;JsonSeat&gt; selectedSeats = (List&lt;JsonSeat&gt;) JavaScriptConvert.DeserializeObject(txt_Selection.Text,typeof(List&lt;JsonSeat&gt;));
&lt;/code&gt;


3. You can now iterate through your objects and access them as expected:


&lt;code&gt;
foreach (JsonSeat seat in selectedSeats) {
	lit_Temp.Text += string.Format(&quot;Seat: {0}; {1}{2}&quot;,seat.id,seat.rowAndNumber,&quot;&lt;br /&gt;&quot;);
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>One last try at posting this code:</p>
<p>Unfortunately the documentation for the Json.Net library is incredibly lacking. After trying out about a billion different things, I&#8217;ve finally figured out how to Deserialize a JavaScript Array of Object Literals in JSON format into something usable on the .Net side.</p>
<p>1. Create a custom class which describes the Object Literals that you&#8217;ll be passing in:</p>
<p><code><br />
/// Used for deserializing JSON objects from JavaScript<br />
public class JsonSeat {<br />
	/// The seat ID (SeatNo)<br />
	public int id;<br />
	/// Name of the Price Type<br />
	public string priceType;<br />
	/// Number of the Price Type<br />
	public int priceTypeID;<br />
	/// Price of the ticket<br />
	public string price;<br />
	/// Name of the seating section<br />
	public string section;<br />
	/// The Row and Number of the seat<br />
	public string rowAndNumber;<br />
	/// The HyperLink.ClientID of the seat &lt;a&gt; element<br />
	public string anchorID;<br />
}<br />
</code></p>
<p>2. Deserialize your JSON string into a List of your custom classes:</p>
<p><code><br />
List&lt;JsonSeat&gt; selectedSeats = (List&lt;JsonSeat&gt;) JavaScriptConvert.DeserializeObject(txt_Selection.Text,typeof(List&lt;JsonSeat&gt;));<br />
</code></p>
<p>3. You can now iterate through your objects and access them as expected:</p>
<p><code><br />
foreach (JsonSeat seat in selectedSeats) {<br />
	lit_Temp.Text += string.Format("Seat: {0}; {1}{2}",seat.id,seat.rowAndNumber,"&lt;br /&gt;");<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-255091</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 06 Sep 2007 17:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-255091</guid>
		<description>Hmmm, pretty much killed it entirely, let&#039;s try it again!

Unfortunately the documentation for the Json.Net library is incredibly lacking. After trying out about a billion different things, I&#039;ve finally figured out how to Deserialize a JavaScript Array of Object Literals in JSON format into something usable on the .Net side. I&#039;m going to try and insert some formatted C# here, hopefully the comment form doesn&#039;t destroy it!

1. Create a custom class which describes the Object Literals that you&#039;ll be passing in:

&lt;code&gt;

	/// Used for deserializing JSON objects from JavaScript
	public class JsonSeat {
		/// The seat ID (SeatNo)
		public int id;
		/// Name of the Price Type
		public string priceType;
		/// Number of the Price Type
		public int priceTypeID;
		/// Price of the ticket
		public string price;
		/// Name of the seating section
		public string section;
		/// The Row and Number of the seat
		public string rowAndNumber;
		/// The HyperLink.ClientID of the seat &lt;a&gt; element
		public string anchorID;
	}

&lt;/code&gt;

2. Deserialize your JSON string into a List of your custom classes:
&lt;code&gt;
List&lt;JsonSeat&gt; selectedSeats = (List&lt;JsonSeat&gt;) JavaScriptConvert.DeserializeObject(txt_Selection.Text,typeof(List&lt;JsonSeat&gt;));
&lt;/code&gt;

3. You can now iterate through your objects and access them as expected:

&lt;code&gt;

foreach (JsonSeat seat in selectedSeats) {
	lit_Temp.Text += string.Format(&quot;Seat: {0}; {1}{2}&quot;,seat.id,seat.rowAndNumber,&quot;&quot;);
}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hmmm, pretty much killed it entirely, let&#8217;s try it again!</p>
<p>Unfortunately the documentation for the Json.Net library is incredibly lacking. After trying out about a billion different things, I&#8217;ve finally figured out how to Deserialize a JavaScript Array of Object Literals in JSON format into something usable on the .Net side. I&#8217;m going to try and insert some formatted C# here, hopefully the comment form doesn&#8217;t destroy it!</p>
<p>1. Create a custom class which describes the Object Literals that you&#8217;ll be passing in:</p>
<p><code></p>
<p>	/// Used for deserializing JSON objects from JavaScript<br />
	public class JsonSeat {<br />
		/// The seat ID (SeatNo)<br />
		public int id;<br />
		/// Name of the Price Type<br />
		public string priceType;<br />
		/// Number of the Price Type<br />
		public int priceTypeID;<br />
		/// Price of the ticket<br />
		public string price;<br />
		/// Name of the seating section<br />
		public string section;<br />
		/// The Row and Number of the seat<br />
		public string rowAndNumber;<br />
		/// The HyperLink.ClientID of the seat &lt;a&gt; element<br />
		public string anchorID;<br />
	}</p>
<p></code></p>
<p>2. Deserialize your JSON string into a List of your custom classes:<br />
<code><br />
List&lt;JsonSeat&gt; selectedSeats = (List&lt;JsonSeat&gt;) JavaScriptConvert.DeserializeObject(txt_Selection.Text,typeof(List&lt;JsonSeat&gt;));<br />
</code></p>
<p>3. You can now iterate through your objects and access them as expected:</p>
<p><code></p>
<p>foreach (JsonSeat seat in selectedSeats) {<br />
	lit_Temp.Text += string.Format("Seat: {0}; {1}{2}",seat.id,seat.rowAndNumber,"");<br />
}</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-255089</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 06 Sep 2007 17:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-255089</guid>
		<description>Unfortunately the documentation for the Json.Net library is incredibly lacking. After trying out about a billion different things, I&#039;ve finally figured out how to Deserialize a JavaScript Array of Object Literals in JSON format into something usable on the .Net side. I&#039;m going to try and insert some formatted C# here, hopefully the comment form doesn&#039;t destroy it!

1. Create a custom class which describes the Object Literals that you&#039;ll be passing in:

&lt;code&gt;

	/// 
	/// Used for deserializing JSON objects from JavaScript
	/// 
	public class JsonSeat {
		/// 
		/// The seat ID (SeatNo)
		/// 
		public int id;
		/// 
		/// Name of the Price Type
		/// 
		public string priceType;
		/// 
		/// Number of the Price Type
		/// 
		public int priceTypeID;
		/// 
		/// Price of the ticket
		/// 
		public string price;
		/// 
		/// Name of the seating section
		/// 
		public string section;
		/// 
		/// The Row and Number of the seat
		/// 
		public string rowAndNumber;
		/// 
		/// The HyperLink.ClientID of the seat &lt;a&gt; element
		/// 
		public string anchorID;
	}

&lt;/a&gt;&lt;/code&gt;

2. Deserialize your JSON string into a List of your custom classes:
&lt;code&gt;

List selectedSeats = (List) JavaScriptConvert.DeserializeObject(txt_Selection.Text,typeof(List));

&lt;/code&gt;

3. You can now iterate through your objects and access them as expected:

&lt;code&gt;

foreach (JsonSeat seat in selectedSeats) {
	lit_Temp.Text += string.Format(&quot;Seat: {0}; {1}{2}&quot;,seat.id,seat.rowAndNumber,&quot;&quot;);
}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Unfortunately the documentation for the Json.Net library is incredibly lacking. After trying out about a billion different things, I&#8217;ve finally figured out how to Deserialize a JavaScript Array of Object Literals in JSON format into something usable on the .Net side. I&#8217;m going to try and insert some formatted C# here, hopefully the comment form doesn&#8217;t destroy it!</p>
<p>1. Create a custom class which describes the Object Literals that you&#8217;ll be passing in:</p>
<p><code></p>
<p>	///<br />
	/// Used for deserializing JSON objects from JavaScript<br />
	///<br />
	public class JsonSeat {<br />
		///<br />
		/// The seat ID (SeatNo)<br />
		///<br />
		public int id;<br />
		///<br />
		/// Name of the Price Type<br />
		///<br />
		public string priceType;<br />
		///<br />
		/// Number of the Price Type<br />
		///<br />
		public int priceTypeID;<br />
		///<br />
		/// Price of the ticket<br />
		///<br />
		public string price;<br />
		///<br />
		/// Name of the seating section<br />
		///<br />
		public string section;<br />
		///<br />
		/// The Row and Number of the seat<br />
		///<br />
		public string rowAndNumber;<br />
		///<br />
		/// The HyperLink.ClientID of the seat <a> element<br />
		///<br />
		public string anchorID;<br />
	}</p>
<p></a></code></p>
<p>2. Deserialize your JSON string into a List of your custom classes:<br />
<code></p>
<p>List selectedSeats = (List) JavaScriptConvert.DeserializeObject(txt_Selection.Text,typeof(List));</p>
<p></code></p>
<p>3. You can now iterate through your objects and access them as expected:</p>
<p><code></p>
<p>foreach (JsonSeat seat in selectedSeats) {<br />
	lit_Temp.Text += string.Format("Seat: {0}; {1}{2}",seat.id,seat.rowAndNumber,"");<br />
}</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-255041</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 06 Sep 2007 00:06:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-255041</guid>
		<description>Can anybody figure out how to deserialize a javascript array into an array of string? The documentation on this class is non-existent!</description>
		<content:encoded><![CDATA[<p>Can anybody figure out how to deserialize a javascript array into an array of string? The documentation on this class is non-existent!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neil</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-254547</link>
		<dc:creator>neil</dc:creator>
		<pubDate>Mon, 27 Aug 2007 21:39:38 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-254547</guid>
		<description>Unfortunately does not run under .net CF 2.0. E.g. System.ComponentModel.TypeDescriptor seems to be not available.

Regards</description>
		<content:encoded><![CDATA[<p>Unfortunately does not run under .net CF 2.0. E.g. System.ComponentModel.TypeDescriptor seems to be not available.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Egg</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-253900</link>
		<dc:creator>Alex Egg</dc:creator>
		<pubDate>Tue, 14 Aug 2007 23:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-253900</guid>
		<description>How does it handle inherited classes? I see self referencing exceptions happening...</description>
		<content:encoded><![CDATA[<p>How does it handle inherited classes? I see self referencing exceptions happening&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hanker</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-248081</link>
		<dc:creator>hanker</dc:creator>
		<pubDate>Tue, 13 Mar 2007 07:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-248081</guid>
		<description>Can dojo be used in Json.net? how</description>
		<content:encoded><![CDATA[<p>Can dojo be used in Json.net? how</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ePeaksoft</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-185164</link>
		<dc:creator>ePeaksoft</dc:creator>
		<pubDate>Wed, 15 Nov 2006 13:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-185164</guid>
		<description>Json.NET has been updated to 1.1 and fixes a number of bugs around serialization.</description>
		<content:encoded><![CDATA[<p>Json.NET has been updated to 1.1 and fixes a number of bugs around serialization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Newton-King</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-44310</link>
		<dc:creator>James Newton-King</dc:creator>
		<pubDate>Tue, 11 Jul 2006 11:34:56 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-44310</guid>
		<description>Json.NET has been updated to 1.1 and fixes a number of bugs around serialization.

While it is now improved not every class can be serialized and deserialized. Some have self referencing loops for example which can cause problems.</description>
		<content:encoded><![CDATA[<p>Json.NET has been updated to 1.1 and fixes a number of bugs around serialization.</p>
<p>While it is now improved not every class can be serialized and deserialized. Some have self referencing loops for example which can cause problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manuela</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-44161</link>
		<dc:creator>Manuela</dc:creator>
		<pubDate>Tue, 11 Jul 2006 07:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-44161</guid>
		<description>I get it not running with .NET 1.1, is there a version conflict? Or do I need to configure something in app.config?</description>
		<content:encoded><![CDATA[<p>I get it not running with .NET 1.1, is there a version conflict? Or do I need to configure something in app.config?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffry</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-43916</link>
		<dc:creator>Jeffry</dc:creator>
		<pubDate>Mon, 10 Jul 2006 23:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-43916</guid>
		<description>It is not working with a lot of data types... :(</description>
		<content:encoded><![CDATA[<p>It is not working with a lot of data types&#8230; :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-43768</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Mon, 10 Jul 2006 12:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-43768</guid>
		<description>I&#039;d like to know what are the benefits using JSON.NET instead of i.e. Atlas or AjaxPro. I only need JSON in web sites, not Windows Forms or Services.</description>
		<content:encoded><![CDATA[<p>I&#8217;d like to know what are the benefits using JSON.NET instead of i.e. Atlas or AjaxPro. I only need JSON in web sites, not Windows Forms or Services.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-43767</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Mon, 10 Jul 2006 12:12:18 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-43767</guid>
		<description>I still get a lot of errors when serializing .net standard types like TimeSpan or DateTime. I use this in my web mailer app with another library without having those problems. What I&#039;m doing wrong?</description>
		<content:encoded><![CDATA[<p>I still get a lot of errors when serializing .net standard types like TimeSpan or DateTime. I use this in my web mailer app with another library without having those problems. What I&#8217;m doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JSON.NET Library &#124; Scriptorama</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-42189</link>
		<dc:creator>JSON.NET Library &#124; Scriptorama</dc:creator>
		<pubDate>Fri, 07 Jul 2006 05:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-42189</guid>
		<description>[...] Een heus berichtje voor de dotnetters onder ons. De Ajaxian meldt dat er een utility library is ontwikkeld voor het gebruik van JSON binnen ASP.NET webapplicaties. De library biedt een makkelijk te gebruiken JsonWriter: PLAIN TEXT C#: [...]</description>
		<content:encoded><![CDATA[<p>[...] Een heus berichtje voor de dotnetters onder ons. De Ajaxian meldt dat er een utility library is ontwikkeld voor het gebruik van JSON binnen ASP.NET webapplicaties. De library biedt een makkelijk te gebruiken JsonWriter: PLAIN TEXT C#: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: beppu</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-41506</link>
		<dc:creator>beppu</dc:creator>
		<pubDate>Wed, 05 Jul 2006 11:21:38 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-41506</guid>
		<description>Cool.  That sounds a lot better.  :-)</description>
		<content:encoded><![CDATA[<p>Cool.  That sounds a lot better.  :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Newton-King</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-41485</link>
		<dc:creator>James Newton-King</dc:creator>
		<pubDate>Wed, 05 Jul 2006 10:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-41485</guid>
		<description>beppu there is a helper method on the JavaScriptConvert class to quickly serialize objects.

string jsonText = JavaScriptConvert.SerializeObject(value);

Morris the JsonWriter and JsonReader are underlying classes and you would really only use them if you wanted exact control over what is written. Normally you would use the JsonSerializer and methods like the one above to convert to and from JSON.</description>
		<content:encoded><![CDATA[<p>beppu there is a helper method on the JavaScriptConvert class to quickly serialize objects.</p>
<p>string jsonText = JavaScriptConvert.SerializeObject(value);</p>
<p>Morris the JsonWriter and JsonReader are underlying classes and you would really only use them if you wanted exact control over what is written. Normally you would use the JsonSerializer and methods like the one above to convert to and from JSON.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ComputerZen.com - Scott Hanselman</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-41400</link>
		<dc:creator>ComputerZen.com - Scott Hanselman</dc:creator>
		<pubDate>Wed, 05 Jul 2006 05:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-41400</guid>
		<description>&lt;strong&gt;Serializing Objects as JavaScript using Atlas, JSON.NET and AjaxPro&lt;/strong&gt;

</description>
		<content:encoded><![CDATA[<p><strong>Serializing Objects as JavaScript using Atlas, JSON.NET and AjaxPro</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morris</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-41358</link>
		<dc:creator>Morris</dc:creator>
		<pubDate>Wed, 05 Jul 2006 02:45:55 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-41358</guid>
		<description>The example code given is not just painfully verbose, it actually ends up making your code really ugly, fragile and inflexible for anything that is not trivial. It forces you to:
* structure your code according to the tree structure of the JSON
* or have a separate method that you pass in the message parameters and create the JSON object
and it limits how you can build up parts of a message to make a whole.

I have experience with this because I implemented the same style API in Delphi and it really sucked.

[I replaced it with variants objects/arrays which is clean, although disadvantage of overhead with variants, but advantage that is good for receiving JSON]</description>
		<content:encoded><![CDATA[<p>The example code given is not just painfully verbose, it actually ends up making your code really ugly, fragile and inflexible for anything that is not trivial. It forces you to:<br />
* structure your code according to the tree structure of the JSON<br />
* or have a separate method that you pass in the message parameters and create the JSON object<br />
and it limits how you can build up parts of a message to make a whole.</p>
<p>I have experience with this because I implemented the same style API in Delphi and it really sucked.</p>
<p>[I replaced it with variants objects/arrays which is clean, although disadvantage of overhead with variants, but advantage that is good for receiving JSON]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: beppu</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-41040</link>
		<dc:creator>beppu</dc:creator>
		<pubDate>Tue, 04 Jul 2006 16:12:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-41040</guid>
		<description>In rails, I can call the .to_json method on any object.  For serialization, that&#039;s the kind of API I&#039;d want.  Anything else is too verbose.</description>
		<content:encoded><![CDATA[<p>In rails, I can call the .to_json method on any object.  For serialization, that&#8217;s the kind of API I&#8217;d want.  Anything else is too verbose.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Newton-King</title>
		<link>http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication/comment-page-1#comment-40945</link>
		<dc:creator>James Newton-King</dc:creator>
		<pubDate>Tue, 04 Jul 2006 11:12:50 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/jsonnet-library-to-help-with-net-js-communication#comment-40945</guid>
		<description>After setting a couple of properties on the JsonWriter class (&lt;i&gt;QuoteChar &lt;/i&gt;to double quotes, &lt;i&gt;QuoteName&lt;/i&gt; to true) you can generate that output Simon.

By default what it outputs now is a valid JavaScript object literal but you&#039;re right that it doesn&#039;t exactly conform to the spec by default. Internally it doesn&#039;t matter as the JsonReader class is pretty robust in that it handles all the different situations, but for the sake of other readers that might be something to change next version.</description>
		<content:encoded><![CDATA[<p>After setting a couple of properties on the JsonWriter class (<i>QuoteChar </i>to double quotes, <i>QuoteName</i> to true) you can generate that output Simon.</p>
<p>By default what it outputs now is a valid JavaScript object literal but you&#8217;re right that it doesn&#8217;t exactly conform to the spec by default. Internally it doesn&#8217;t matter as the JsonReader class is pretty robust in that it handles all the different situations, but for the sake of other readers that might be something to change next version.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

