<?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: A breaking change between versions of ASP.NET AJAX</title>
	<atom:link href="http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/</link>
	<description>ASP.NET and AJAX code, ideas, and examples.</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:50:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jim Tomney</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-47521</link>
		<dc:creator>Jim Tomney</dc:creator>
		<pubDate>Fri, 18 Nov 2011 21:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-47521</guid>
		<description>Dave,

Thanks very much for clearing this up. It took a couple of days for me to track down why our jQuery.ajax calls had gone bad when we upgraded so it&#039;s really nice to get the full story behind why this came about. You definitely rock! :-)

Jim</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>Thanks very much for clearing this up. It took a couple of days for me to track down why our jQuery.ajax calls had gone bad when we upgraded so it&#8217;s really nice to get the full story behind why this came about. You definitely rock! :-)</p>
<p>Jim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jquery Ajax ile Herhangi Bir ASP.NET WebService&#8217;ini Tüketmek &#124; Barış Velioğlu&#039;nun Programlama Notları</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-47209</link>
		<dc:creator>Jquery Ajax ile Herhangi Bir ASP.NET WebService&#8217;ini Tüketmek &#124; Barış Velioğlu&#039;nun Programlama Notları</dc:creator>
		<pubDate>Wed, 09 Nov 2011 13:27:39 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-47209</guid>
		<description>[...] A breaking change between versions of asp.net ajax [...]</description>
		<content:encoded><![CDATA[<p>[...] A breaking change between versions of asp.net ajax [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sabarish</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-45929</link>
		<dc:creator>Sabarish</dc:creator>
		<pubDate>Sat, 17 Sep 2011 15:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-45929</guid>
		<description>Excellent mate,

This worked for me.

Thanks you very for your help.

I will try to pass this message from my site,so to avoid this pitfall.

Thanks Again.

Regards,

Sabarish</description>
		<content:encoded><![CDATA[<p>Excellent mate,</p>
<p>This worked for me.</p>
<p>Thanks you very for your help.</p>
<p>I will try to pass this message from my site,so to avoid this pitfall.</p>
<p>Thanks Again.</p>
<p>Regards,</p>
<p>Sabarish</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-45928</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Sat, 17 Sep 2011 12:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-45928</guid>
		<description>Yes, that&#039;s the reason. You can read more about it here: http://encosia.com/asp-net-web-services-mistake-manual-json-serialization/

You can return that List&lt;T&gt; directly and ASP.NET will handle the serialization for you. For example, if those items are of type BudgetStatus, then this server-side code is what you should use:

&lt;pre lang=&quot;csharp&quot;&gt;public static List&lt;BudgetStatus&gt; getData(int AreaID) {
  // Build your list however you were before.
  var result = getBudgetDataByArea(AreaID);

  // But then just return it directly.
  // ASP.NET will handle the JSON for you.
  return result;
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Yes, that&#8217;s the reason. You can read more about it here: <a href="http://encosia.com/asp-net-web-services-mistake-manual-json-serialization/" rel="nofollow">http://encosia.com/asp-net-web-services-mistake-manual-json-serialization/</a></p>
<p>You can return that List<t> directly and ASP.NET will handle the serialization for you. For example, if those items are of type BudgetStatus, then this server-side code is what you should use:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> List<span style="color: #008000;">&lt;</span>BudgetStatus<span style="color: #008000;">&gt;</span> getData<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> AreaID<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #008080; font-style: italic;">// Build your list however you were before.</span>
  var result <span style="color: #008000;">=</span> getBudgetDataByArea<span style="color: #000000;">&#40;</span>AreaID<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
  <span style="color: #008080; font-style: italic;">// But then just return it directly.</span>
  <span style="color: #008080; font-style: italic;">// ASP.NET will handle the JSON for you.</span>
  <span style="color: #0600FF;">return</span> result<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p></t></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sabarish</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-45924</link>
		<dc:creator>Sabarish</dc:creator>
		<pubDate>Sat, 17 Sep 2011 09:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-45924</guid>
		<description>Hi Dave,

Thanks for the reply.

I tried the above but still it says undefined.

but if say 

alert(data.d[0]);

then it returns the first square bracket.

Is this because i am getting the object data from code behind using 

JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();               return javaScriptSerializer.Serialize(list); 

?

Regards,

Sabarish</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Thanks for the reply.</p>
<p>I tried the above but still it says undefined.</p>
<p>but if say </p>
<p>alert(data.d[0]);</p>
<p>then it returns the first square bracket.</p>
<p>Is this because i am getting the object data from code behind using </p>
<p>JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();               return javaScriptSerializer.Serialize(list); </p>
<p>?</p>
<p>Regards,</p>
<p>Sabarish</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-45910</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Fri, 16 Sep 2011 14:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-45910</guid>
		<description>Since that&#039;s an array, you&#039;d need to index into it like:

&lt;pre lang=&quot;javascript&quot;&gt;alert(data.d[0].id); // 1

alert(data.d[1].description); // Budget Load Completed&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Since that&#8217;s an array, you&#8217;d need to index into it like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">d</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 1</span>
&nbsp;
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">d</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">description</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Budget Load Completed</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Sabarish</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-45909</link>
		<dc:creator>Sabarish</dc:creator>
		<pubDate>Fri, 16 Sep 2011 13:35:27 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-45909</guid>
		<description>My Script


   
&lt;pre lang=&quot;javascript&quot;&gt;       $(function() {
           var areaId = 42;
           $.ajax({

               type: &quot;POST&quot;,
               url: &quot;Data.aspx/getData&quot;,
               contentType: &quot;application/json; charset=utf-8&quot;,
               dataType: &quot;json&quot;,
               success: function(data) {
                    
                   alert(data.d.id);

               }
           });
       });&lt;/pre&gt;
      

Says undefined in the alert box.

My json data

&lt;pre lang=&quot;javascript&quot;&gt;[{&quot;id&quot;:&quot;1&quot;,&quot;description&quot;:&quot;Budget Load Started&quot;},
{&quot;id&quot;:&quot;2&quot;,&quot;description&quot;:&quot;Budget Load Completed&quot;}]&lt;/pre&gt;

Any help will be much appreciated.

Regards,

Sabarish</description>
		<content:encoded><![CDATA[<p>My Script</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">       $<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #003366; font-weight: bold;">var</span> areaId <span style="color: #339933;">=</span> <span style="color: #CC0000;">42</span><span style="color: #339933;">;</span>
           $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
&nbsp;
               type<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">,</span>
               url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Data.aspx/getData&quot;</span><span style="color: #339933;">,</span>
               contentType<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;application/json; charset=utf-8&quot;</span><span style="color: #339933;">,</span>
               dataType<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;json&quot;</span><span style="color: #339933;">,</span>
               success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                   <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">d</span>.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
               <span style="color: #009900;">&#125;</span>
           <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Says undefined in the alert box.</p>
<p>My json data</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;description&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Budget Load Started&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;description&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Budget Load Completed&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span></pre></div></div>

<p>Any help will be much appreciated.</p>
<p>Regards,</p>
<p>Sabarish</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ASP.NET jQuery Cookbook: Chapter 4, 5, 6 &#124; Study Notes: JQuery</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-44756</link>
		<dc:creator>ASP.NET jQuery Cookbook: Chapter 4, 5, 6 &#124; Study Notes: JQuery</dc:creator>
		<pubDate>Wed, 17 Aug 2011 16:58:29 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-44756</guid>
		<description>[...] Explanation: http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Explanation: <a href="http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/" rel="nofollow">http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajax via jQuery and ASP.NET &#171; Pseudorandom Knowledge</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-44503</link>
		<dc:creator>Ajax via jQuery and ASP.NET &#171; Pseudorandom Knowledge</dc:creator>
		<pubDate>Wed, 03 Aug 2011 01:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-44503</guid>
		<description>[...] puzzling change here. We have to include an extra .d when getting the returned data. This is a security feature that prevents certain XSS [...]</description>
		<content:encoded><![CDATA[<p>[...] puzzling change here. We have to include an extra .d when getting the returned data. This is a security feature that prevents certain XSS [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay Kumar</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-44332</link>
		<dc:creator>Ajay Kumar</dc:creator>
		<pubDate>Sun, 10 Jul 2011 17:56:40 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-44332</guid>
		<description>Thanks a lot. I have wasted 2 days in finding .d and finally got on your site.

Thanks a lot again.</description>
		<content:encoded><![CDATA[<p>Thanks a lot. I have wasted 2 days in finding .d and finally got on your site.</p>
<p>Thanks a lot again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ASP.NET, AJAX i JSON &#171; Asp.net &#171; Web Development &#171; Pure Development Blog</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-43334</link>
		<dc:creator>ASP.NET, AJAX i JSON &#171; Asp.net &#171; Web Development &#171; Pure Development Blog</dc:creator>
		<pubDate>Sun, 08 May 2011 00:06:14 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-43334</guid>
		<description>[...] odpowiedź. Programiści w Microsofcie tłumaczą takie posunięcie względami bezpieczeństwa (tutaj jest to pokrótce wyjaśnione). Cóż… może mają rację, ale w dalszym ciągu mogli dać możliwość wykorzystania jakiejś [...]</description>
		<content:encoded><![CDATA[<p>[...] odpowiedź. Programiści w Microsofcie tłumaczą takie posunięcie względami bezpieczeństwa (tutaj jest to pokrótce wyjaśnione). Cóż… może mają rację, ale w dalszym ciągu mogli dać możliwość wykorzystania jakiejś [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Green</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-43200</link>
		<dc:creator>Green</dc:creator>
		<pubDate>Wed, 20 Apr 2011 14:06:14 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-43200</guid>
		<description>&lt;b&gt;hi thanx. i was simply very helpful to understand the  entire concept... :)))) &lt;/b&gt;</description>
		<content:encoded><![CDATA[<p><b>hi thanx. i was simply very helpful to understand the  entire concept&#8230; :)))) </b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-41966</link>
		<dc:creator>Jordan</dc:creator>
		<pubDate>Wed, 02 Feb 2011 17:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-41966</guid>
		<description>So here is my scenario..
I am calling a webmethod from the client side using jquery ajax...
The webmethod in C# is making an httprequest to a service (Yelp)...
The service is returning a string in JSON structure...
Can I just return that string straight bcak to the client side or do I need to format it to be a true JSON object?</description>
		<content:encoded><![CDATA[<p>So here is my scenario..<br />
I am calling a webmethod from the client side using jquery ajax&#8230;<br />
The webmethod in C# is making an httprequest to a service (Yelp)&#8230;<br />
The service is returning a string in JSON structure&#8230;<br />
Can I just return that string straight bcak to the client side or do I need to format it to be a true JSON object?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Very useful way to consume ASMX web service in Jquery and the mysterious &#8220;d&#8221; object in .net framework 3.5 &#171; Sansknowledge&#039;s Blog</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-41702</link>
		<dc:creator>A Very useful way to consume ASMX web service in Jquery and the mysterious &#8220;d&#8221; object in .net framework 3.5 &#171; Sansknowledge&#039;s Blog</dc:creator>
		<pubDate>Thu, 13 Jan 2011 07:55:53 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-41702</guid>
		<description>[...] http://encosia.com/2009/02/10/a-breaking-change-between-versions-of-aspnet-ajax/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://encosia.com/2009/02/10/a-breaking-change-between-versions-of-aspnet-ajax/" rel="nofollow">http://encosia.com/2009/02/10/a-breaking-change-between-versions-of-aspnet-ajax/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sagar</title>
		<link>http://encosia.com/a-breaking-change-between-versions-of-aspnet-ajax/#comment-41661</link>
		<dc:creator>sagar</dc:creator>
		<pubDate>Thu, 06 Jan 2011 06:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=817#comment-41661</guid>
		<description>its really helpful.
good job</description>
		<content:encoded><![CDATA[<p>its really helpful.<br />
good job</p>
]]></content:encoded>
	</item>
</channel>
</rss>

