<?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 sneak peak at ASP.NET AJAX 4.0&#8217;s client-side templating</title>
	<atom:link href="http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/feed/" rel="self" type="application/rss+xml" />
	<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/</link>
	<description>ASP.NET and AJAX code, ideas, and examples.</description>
	<lastBuildDate>Thu, 11 Mar 2010 18:05:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Top 10 Upcoming Microsoft Releases That Developers Should be Excited About &#124; Garrett&#39;s Tech Musings</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-36786</link>
		<dc:creator>Top 10 Upcoming Microsoft Releases That Developers Should be Excited About &#124; Garrett&#39;s Tech Musings</dc:creator>
		<pubDate>Sat, 17 Oct 2009 14:19:26 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-36786</guid>
		<description>[...] which provides an easier and simpler method of displaying dynamic data.  Take a look at this overview to get an idea of how this all works and how this brings pure AJAX and JSON data interaction into [...]</description>
		<content:encoded><![CDATA[<p>[...] which provides an easier and simpler method of displaying dynamic data.  Take a look at this overview to get an idea of how this all works and how this brings pure AJAX and JSON data interaction into [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-36003</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 29 Jul 2009 17:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-36003</guid>
		<description>You can use:

&lt;pre lang=&quot;javascript&quot;&gt;code:after=&quot;$element.innerHTML = YourHTMLField;&quot;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You can use:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">code<span style="color: #339933;">:</span>after<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;$element.innerHTML = YourHTMLField;&quot;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Henk</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-35940</link>
		<dc:creator>Henk</dc:creator>
		<pubDate>Thu, 23 Jul 2009 22:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-35940</guid>
		<description>All works fine, but what if I have some HTML markup in JSON data, such as B, I, U, etc tags? As I can see all markup is escaped :(
Does anyone has a solution? May be i&#039;m doing something wrong?</description>
		<content:encoded><![CDATA[<p>All works fine, but what if I have some HTML markup in JSON data, such as B, I, U, etc tags? As I can see all markup is escaped :(<br />
Does anyone has a solution? May be i&#8217;m doing something wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Evans</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-34162</link>
		<dc:creator>Steve Evans</dc:creator>
		<pubDate>Fri, 20 Feb 2009 12:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-34162</guid>
		<description>Dave, thanks for the update regarding this. 

I think that while the example you provided doesn&#039;t quite fit what I want to do, in that I have table headings that I also don&#039;t want to be visible unless some results are returned, it certainly is useful to know about using the itemPlaceHolder property of the DataView.

I guess what I&#039;ll need to do is to make the whole table not visble prior to binding and then once the DataBinding has occurred look to see if data was retrieved and then just make the table vsisible or not.

Thanks again.</description>
		<content:encoded><![CDATA[<p>Dave, thanks for the update regarding this. </p>
<p>I think that while the example you provided doesn&#8217;t quite fit what I want to do, in that I have table headings that I also don&#8217;t want to be visible unless some results are returned, it certainly is useful to know about using the itemPlaceHolder property of the DataView.</p>
<p>I guess what I&#8217;ll need to do is to make the whole table not visble prior to binding and then once the DataBinding has occurred look to see if data was retrieved and then just make the table vsisible or not.</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Reed</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-34143</link>
		<dc:creator>Dave Reed</dc:creator>
		<pubDate>Thu, 19 Feb 2009 00:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-34143</guid>
		<description>Steve -- in the earlier bits, if you set the item template of a DataView, it was ok if it was contained within the DataView, because we implied that the item placeholder is where the template is. For various reasons, we changed that in the next preview release. Now, if you set itemTemplate, the template can&#039;t be a child of the DataView. So, actually you get one little feature out of that, in that the stuff initially inside the table of the DataView is what shows up prior to any data being loaded (you may even have a cell or something that says &#039;now loading...&#039;).

So you will need to build a table that contains a placeholder describing where the template instances should go, and seperately define a template table. Something like this:

&lt;pre lang=&quot;html&quot;&gt;&lt;table id=&quot;results&quot;&gt;
  &lt;tbody&gt;
     &lt;tr id=&quot;ph&quot;&gt;
        &lt;td&gt;Now Loading...&lt;/td&gt;
     &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;


&lt;table style=&quot;display:hidden&quot;&gt;
  &lt;tbody id=&quot;searchResultItems&quot; class=&quot;sys-template&quot;&gt;
      &lt;tr&gt;&lt;td&gt;...&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;&lt;/pre&gt;

Then do what you are doing except also set dataView.set_itemPlaceholder to the ph element. When the DataView renders, the placeholder element (the TR containing the TD &quot;now loading&quot;) is completely removed, and the instances of the template are inserted into the tbody at the point where it was. So that also means, by the way, you can define header/footer rows, like so:

&lt;pre lang=&quot;html&quot;&gt;&lt;table id=&quot;results&quot;&gt;
  &lt;tbody&gt;
     &lt;tr&gt;&lt;td&gt;header&lt;/td&gt;&lt;/tr&gt;
     &lt;tr id=&quot;ph&quot;&gt;
        &lt;td&gt;Now Loading...&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;footer&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;&lt;/pre&gt;

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Steve &#8212; in the earlier bits, if you set the item template of a DataView, it was ok if it was contained within the DataView, because we implied that the item placeholder is where the template is. For various reasons, we changed that in the next preview release. Now, if you set itemTemplate, the template can&#8217;t be a child of the DataView. So, actually you get one little feature out of that, in that the stuff initially inside the table of the DataView is what shows up prior to any data being loaded (you may even have a cell or something that says &#8216;now loading&#8230;&#8217;).</p>
<p>So you will need to build a table that contains a placeholder describing where the template instances should go, and seperately define a template table. Something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;results&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tbody&gt;</span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ph&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></span>Now Loading...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tbody&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table&gt;</span></span>
&nbsp;
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;display:hidden&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tbody</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;searchResultItems&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sys-template&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;">&lt;tr&gt;&lt;td&gt;</span>...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #66cc66;">/</span>td&gt;&lt;<span style="color: #66cc66;">/</span>tr&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tbody&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table&gt;</span></span></pre></div></div>

<p>Then do what you are doing except also set dataView.set_itemPlaceholder to the ph element. When the DataView renders, the placeholder element (the TR containing the TD &#8220;now loading&#8221;) is completely removed, and the instances of the template are inserted into the tbody at the point where it was. So that also means, by the way, you can define header/footer rows, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;results&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tbody&gt;</span></span>
     <span style="color: #009900;">&lt;tr&gt;&lt;td&gt;</span>header<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #66cc66;">/</span>td&gt;&lt;<span style="color: #66cc66;">/</span>tr&gt;</span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ph&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></span>Now Loading...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span>
     <span style="color: #009900;">&lt;tr&gt;&lt;td&gt;</span>footer<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #66cc66;">/</span>td&gt;&lt;<span style="color: #66cc66;">/</span>tr&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tbody&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table&gt;</span></span></pre></div></div>

<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Evans</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-34121</link>
		<dc:creator>Steve Evans</dc:creator>
		<pubDate>Tue, 17 Feb 2009 09:30:52 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-34121</guid>
		<description>I&#039;m not sure if anyone is still monitoring this thread or not but just in case.

I am having trouble binding a DataView where the template is inside a table. What I want to be able to do is have the template for the DataView be a tbody that will repeat for the number of search results returned by the DataSource assigned to my DataView. I therefore don’t want any of the table visible should zero results be returned.

In Dave&#039;s comment he mentions that I should attach the DataView to the table but point the template at the tbody.
I have tried a number of different things here but may just be doing something obviously wrong. 

What I have so far is:
searchResultsListView = $create(Sys.UI.DataView, { dataSource: searchResultsDataSource }, { itemCreated: onSearchResultItemCreated }, {}, $get(&#039;results&#039;));
searchResultsListView.set_itemTemplate(&#039;searchResultItems&#039;);

Where &#039;results&#039; is the whole table and is &#039;searchResultItems&#039; what should be the repeating tbody.

The error that I get is being thrown from Sys$UI$DataView$_getTemplate() where it does this:

if ((e !== template) &amp;&amp; this._elementContains(e, template, true)) {
throw Error.invalidOperation(Sys.TemplateRes.misplacedTemplate);
}

And the error is: &#039;DataView item template must not be a child element of the DataView.&#039; 

The template is searchResultsItem and e (element) is the results (the table that will contain the repeated items).</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure if anyone is still monitoring this thread or not but just in case.</p>
<p>I am having trouble binding a DataView where the template is inside a table. What I want to be able to do is have the template for the DataView be a tbody that will repeat for the number of search results returned by the DataSource assigned to my DataView. I therefore don’t want any of the table visible should zero results be returned.</p>
<p>In Dave&#8217;s comment he mentions that I should attach the DataView to the table but point the template at the tbody.<br />
I have tried a number of different things here but may just be doing something obviously wrong. </p>
<p>What I have so far is:<br />
searchResultsListView = $create(Sys.UI.DataView, { dataSource: searchResultsDataSource }, { itemCreated: onSearchResultItemCreated }, {}, $get(&#8216;results&#8217;));<br />
searchResultsListView.set_itemTemplate(&#8217;searchResultItems&#8217;);</p>
<p>Where &#8216;results&#8217; is the whole table and is &#8217;searchResultItems&#8217; what should be the repeating tbody.</p>
<p>The error that I get is being thrown from Sys$UI$DataView$_getTemplate() where it does this:</p>
<p>if ((e !== template) &amp;&amp; this._elementContains(e, template, true)) {<br />
throw Error.invalidOperation(Sys.TemplateRes.misplacedTemplate);<br />
}</p>
<p>And the error is: &#8216;DataView item template must not be a child element of the DataView.&#8217; </p>
<p>The template is searchResultsItem and e (element) is the results (the table that will contain the repeated items).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fonny Lasmana</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-33980</link>
		<dc:creator>Fonny Lasmana</dc:creator>
		<pubDate>Thu, 29 Jan 2009 14:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-33980</guid>
		<description>Can you help me translate this to VB? I used codechanger.com but it fails to convert properly. 

[WebMethod]
public static IEnumerable GetFeedburnerItems()
{
  XDocument feedXML = 
    XDocument.Load(&quot;http://feeds.encosia.com/Encosia&quot;);
 
  var feeds = 
    from feed in feedXML.Descendants(&quot;item&quot;)
    select new
    {
      Date = DateTime.Parse(feed.Element(&quot;pubDate&quot;).Value)
                     .ToShortDateString(),
      Title = feed.Element(&quot;title&quot;).Value,
      Link = feed.Element(&quot;link&quot;).Value,
      Description = feed.Element(&quot;description&quot;).Value
    };
 
  return feeds;
}

PS: I got error message when VB web service returns IENumerable datatype: Can&#039;t serialize IENumerable.</description>
		<content:encoded><![CDATA[<p>Can you help me translate this to VB? I used codechanger.com but it fails to convert properly. </p>
<p>[WebMethod]<br />
public static IEnumerable GetFeedburnerItems()<br />
{<br />
  XDocument feedXML =<br />
    XDocument.Load(&#8220;http://feeds.encosia.com/Encosia&#8221;);</p>
<p>  var feeds =<br />
    from feed in feedXML.Descendants(&#8220;item&#8221;)<br />
    select new<br />
    {<br />
      Date = DateTime.Parse(feed.Element(&#8220;pubDate&#8221;).Value)<br />
                     .ToShortDateString(),<br />
      Title = feed.Element(&#8220;title&#8221;).Value,<br />
      Link = feed.Element(&#8220;link&#8221;).Value,<br />
      Description = feed.Element(&#8220;description&#8221;).Value<br />
    };</p>
<p>  return feeds;<br />
}</p>
<p>PS: I got error message when VB web service returns IENumerable datatype: Can&#8217;t serialize IENumerable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rem</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-33103</link>
		<dc:creator>Rem</dc:creator>
		<pubDate>Tue, 04 Nov 2008 14:16:51 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-33103</guid>
		<description>Nice blog...</description>
		<content:encoded><![CDATA[<p>Nice blog&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghu Rajbhandari</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-32659</link>
		<dc:creator>Raghu Rajbhandari</dc:creator>
		<pubDate>Tue, 21 Oct 2008 12:26:58 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-32659</guid>
		<description>It didn&#039;t work in IE on my end.</description>
		<content:encoded><![CDATA[<p>It didn&#8217;t work in IE on my end.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghu Rajbhandari</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-32654</link>
		<dc:creator>Raghu Rajbhandari</dc:creator>
		<pubDate>Tue, 21 Oct 2008 11:17:01 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-32654</guid>
		<description>The sample didn&#039;t work on my end.</description>
		<content:encoded><![CDATA[<p>The sample didn&#8217;t work on my end.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thanigainathan.S</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-32635</link>
		<dc:creator>Thanigainathan.S</dc:creator>
		<pubDate>Mon, 20 Oct 2008 19:19:29 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-32635</guid>
		<description>Hi,

This is a nice article.Helped very much with ajax preview 2 experimenting.

Thanks,
Thani</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is a nice article.Helped very much with ajax preview 2 experimenting.</p>
<p>Thanks,<br />
Thani</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Reed</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-32006</link>
		<dc:creator>Dave Reed</dc:creator>
		<pubDate>Fri, 22 Aug 2008 17:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-32006</guid>
		<description>Jeremy -- sure, namespaces are fine at the local level (not anywhere though -- only on the root of the template). sys:activate isn&#039;t, but we&#039;re looking at ways of making that more accessible from content pages and user controls, too. Thanks for the feedback.</description>
		<content:encoded><![CDATA[<p>Jeremy &#8212; sure, namespaces are fine at the local level (not anywhere though &#8212; only on the root of the template). sys:activate isn&#8217;t, but we&#8217;re looking at ways of making that more accessible from content pages and user controls, too. Thanks for the feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-32005</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Fri, 22 Aug 2008 16:45:43 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-32005</guid>
		<description>This works perfectly; thanks, again.  

In a real world setup it should be noted that the  element will often be in a master page where as data bound items will quite likely be in a user control.  Setting up a passthrough from control to page to master template is definitely possible, but it&#039;s a lot of wiring for a common task.  For this reason, I really liked the fact that other namespaces could be defined at the local level.  This might be worth accounting for in future versions.</description>
		<content:encoded><![CDATA[<p>This works perfectly; thanks, again.  </p>
<p>In a real world setup it should be noted that the  element will often be in a master page where as data bound items will quite likely be in a user control.  Setting up a passthrough from control to page to master template is definitely possible, but it&#8217;s a lot of wiring for a common task.  For this reason, I really liked the fact that other namespaces could be defined at the local level.  This might be worth accounting for in future versions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Reed</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-31998</link>
		<dc:creator>Dave Reed</dc:creator>
		<pubDate>Fri, 22 Aug 2008 07:41:49 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-31998</guid>
		<description>sys:activate is only supported on the body element, move it there (may as well move the ns definitions too, only sys:attach is needed on the div). So your problem is the dataview simply isnt being created.</description>
		<content:encoded><![CDATA[<p>sys:activate is only supported on the body element, move it there (may as well move the ns definitions too, only sys:attach is needed on the div). So your problem is the dataview simply isnt being created.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://encosia.com/2008/07/23/sneak-peak-aspnet-ajax-4-client-side-templating/#comment-31996</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Fri, 22 Aug 2008 06:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=86#comment-31996</guid>
		<description>Thanks for the quick reply, Dave.  That&#039;s how I was referencing it so the error must be how I&#039;m wiring up the declarative markup.

If I&#039;m following your notes, I should be able to use the following:

&lt;pre lang=&quot;html&quot;&gt;&lt;div xmlns:sys=&quot;javascript:Sys&quot; xmlns:dv=&quot;javascript:Sys.Preview.UI.DataView&quot; sys:activate=&quot;RSSItem&quot;&gt;
  &lt;div id=&quot;RSSItem&quot; class=&quot;sys-template&quot; sys:attach=&quot;dv&quot;&gt;
    &lt;h1&gt;{{ Title }}&lt;/h2&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/pre&gt;

And then, in my call back, simply say:

&lt;pre lang=&quot;javascript&quot;&gt;$find(&#039;RSSItem&#039;).set_data(result);&lt;/pre&gt;

When I do this, however, I get a null reference on $find(); this works perfectly, however, if I attach the dataview using $create() instead of the declarative markup.</description>
		<content:encoded><![CDATA[<p>Thanks for the quick reply, Dave.  That&#8217;s how I was referencing it so the error must be how I&#8217;m wiring up the declarative markup.</p>
<p>If I&#8217;m following your notes, I should be able to use the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> xmlns:sys<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:Sys&quot;</span> xmlns:dv<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:Sys.Preview.UI.DataView&quot;</span> sys:activate<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;RSSItem&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;RSSItem&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sys-template&quot;</span> sys:attach<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;dv&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></span>{{ Title }}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h2&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></pre></div></div>

<p>And then, in my call back, simply say:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$find<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'RSSItem'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">set_data</span><span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>When I do this, however, I get a null reference on $find(); this works perfectly, however, if I attach the dataview using $create() instead of the declarative markup.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
