<?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: Using the jTemplate jquery plugin with ajax and ASP.NET</title>
	<atom:link href="http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/</link>
	<description>Everything .NET and C#</description>
	<lastBuildDate>Wed, 01 Feb 2012 21:25:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: Faheem Ahmad</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-21267</link>
		<dc:creator>Faheem Ahmad</dc:creator>
		<pubDate>Mon, 14 Nov 2011 02:05:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-21267</guid>
		<description>Hi Joe,
You simply put a great job.
It is really simple to understand.
Thanks dude.
Keep it up.</description>
		<content:encoded><![CDATA[<p>Hi Joe,<br />
You simply put a great job.<br />
It is really simple to understand.<br />
Thanks dude.<br />
Keep it up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nadav</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-20921</link>
		<dc:creator>Nadav</dc:creator>
		<pubDate>Mon, 04 Jul 2011 12:45:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-20921</guid>
		<description>Very clear and helpful, as usual.

Thank you.</description>
		<content:encoded><![CDATA[<p>Very clear and helpful, as usual.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-20884</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Thu, 16 Jun 2011 23:05:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-20884</guid>
		<description>Hi Joshy

It&#039;s hard to guess you problem without seeing your code, but as a pure guess, if you&#039;re adding a textbox and a button inside a jTemplate you may need to use the jQuery.Live function to hook up the event handlers.

Cheers
Joe</description>
		<content:encoded><![CDATA[<p>Hi Joshy</p>
<p>It&#8217;s hard to guess you problem without seeing your code, but as a pure guess, if you&#8217;re adding a textbox and a button inside a jTemplate you may need to use the jQuery.Live function to hook up the event handlers.</p>
<p>Cheers<br />
Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshy</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-20881</link>
		<dc:creator>Joshy</dc:creator>
		<pubDate>Wed, 15 Jun 2011 09:49:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-20881</guid>
		<description>Hi ,

Very thanks for the article. 

I have added button and text boxes to template and its working fine for me.But i am not getting the textbox value when i click on the button .Any help is greatly appreciated.
Thanks,
Joshy</description>
		<content:encoded><![CDATA[<p>Hi ,</p>
<p>Very thanks for the article. </p>
<p>I have added button and text boxes to template and its working fine for me.But i am not getting the textbox value when i click on the button .Any help is greatly appreciated.<br />
Thanks,<br />
Joshy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: celio</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-20810</link>
		<dc:creator>celio</dc:creator>
		<pubDate>Thu, 28 Apr 2011 16:01:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-20810</guid>
		<description>nice and clean thanks!!!</description>
		<content:encoded><![CDATA[<p>nice and clean thanks!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Smith</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-20807</link>
		<dc:creator>Paul Smith</dc:creator>
		<pubDate>Wed, 27 Apr 2011 09:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-20807</guid>
		<description>Joe,
Thanks for your well explained and useful example! I&#039;ll be able to put this (and another of your examples) to good use today.
Paul</description>
		<content:encoded><![CDATA[<p>Joe,<br />
Thanks for your well explained and useful example! I&#8217;ll be able to put this (and another of your examples) to good use today.<br />
Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-20768</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Sat, 26 Feb 2011 00:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-20768</guid>
		<description>Hey Craig

Yeah that&#039;s possible. I assume your hidden field is set outside of your jTemplate somewhere?

Here is how I&#039;d do it with my for loop example using the Forename, which you could easily adapt for your Id.

Add a hidden field to my form  (I&#039;m using a hardcoded value)
[html]
&lt;input type=&quot;button&quot; value=&quot;Get Customers&quot; onclick=&quot;CallService();&quot; /&gt;
&lt;input id=&quot;hidName&quot; type=&quot;hidden&quot; value=&quot;Emily&quot; /&gt;
&lt;div id=&quot;placeholder&quot; style=&quot;clear: both;&quot;&gt;&lt;/div&gt;
[/html]

Pass the value of this hidden field as a paramater to the template when I press the Get Customers button. Am using jQuery to get the value from the hidden field.
[javascript]
$(&#039;#placeholder&#039;).setTemplateURL(&#039;JTemplates/ForEachTemplate.htm&#039;);
$(&#039;#placeholder&#039;).setParam(&#039;hidName&#039;, $(&#039;#hidName&#039;).val());
$(&#039;#placeholder&#039;).processTemplate(data.d);
[/javascript]

Use the #if jTemplate syntax in the jTemplate loop to check if the current name matches the parameter value and if so dispay the delete button
[html]
{#if $T.Customer.Forename == $P.hidName }
    &lt;td&gt;
        &lt;input type=&quot;button&quot; value=&quot;Delete&quot; /&gt;
    &lt;/td&gt;
{#else}
    &lt;td&gt;&lt;/td&gt;
{#/if}
[/html]

Hope that helps


Joe</description>
		<content:encoded><![CDATA[<p>Hey Craig</p>
<p>Yeah that&#8217;s possible. I assume your hidden field is set outside of your jTemplate somewhere?</p>
<p>Here is how I&#8217;d do it with my for loop example using the Forename, which you could easily adapt for your Id.</p>
<p>Add a hidden field to my form  (I&#8217;m using a hardcoded value)</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=&quot;button&quot; value=&quot;Get Customers&quot; onclick=&quot;CallService();&quot; /&gt;
&lt;input id=&quot;hidName&quot; type=&quot;hidden&quot; value=&quot;Emily&quot; /&gt;
&lt;div id=&quot;placeholder&quot; style=&quot;clear: both;&quot;&gt;&lt;/div&gt;
</pre>
<p>Pass the value of this hidden field as a paramater to the template when I press the Get Customers button. Am using jQuery to get the value from the hidden field.</p>
<pre class="brush: jscript; title: ; notranslate">
$('#placeholder').setTemplateURL('JTemplates/ForEachTemplate.htm');
$('#placeholder').setParam('hidName', $('#hidName').val());
$('#placeholder').processTemplate(data.d);
</pre>
<p>Use the #if jTemplate syntax in the jTemplate loop to check if the current name matches the parameter value and if so dispay the delete button</p>
<pre class="brush: xml; title: ; notranslate">
{#if $T.Customer.Forename == $P.hidName }
    &lt;td&gt;
        &lt;input type=&quot;button&quot; value=&quot;Delete&quot; /&gt;
    &lt;/td&gt;
{#else}
    &lt;td&gt;&lt;/td&gt;
{#/if}
</pre>
<p>Hope that helps</p>
<p>Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-20766</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Wed, 23 Feb 2011 14:43:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-20766</guid>
		<description>Another great post!

Question:  I need to hide/show a &quot;delete&quot; button in my template.  In my json object returned I have &#039;created_by_id&#039;.  If &#039;created_by_id&#039; = a hidden value on my form (hdn_user_id) then I want to display the delete button.  Otherwise I want to hide it.  

Can I do this w/ the template approach?

thanks,
Craig</description>
		<content:encoded><![CDATA[<p>Another great post!</p>
<p>Question:  I need to hide/show a &#8220;delete&#8221; button in my template.  In my json object returned I have &#8216;created_by_id&#8217;.  If &#8216;created_by_id&#8217; = a hidden value on my form (hdn_user_id) then I want to display the delete button.  Otherwise I want to hide it.  </p>
<p>Can I do this w/ the template approach?</p>
<p>thanks,<br />
Craig</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-3434</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Sat, 11 Sep 2010 14:51:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-3434</guid>
		<description>Wish I found that earlier, it&#039;s so simple to create a AJAX templating system using jQuery and jTemplate with this explanation! No problem with de webservice returning XML when you know the trick of data.d!

Thanks for the great post!</description>
		<content:encoded><![CDATA[<p>Wish I found that earlier, it&#8217;s so simple to create a AJAX templating system using jQuery and jTemplate with this explanation! No problem with de webservice returning XML when you know the trick of data.d!</p>
<p>Thanks for the great post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1798</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Wed, 19 May 2010 13:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1798</guid>
		<description>Thanks for the clear and detailed explanation!</description>
		<content:encoded><![CDATA[<p>Thanks for the clear and detailed explanation!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amy</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1658</link>
		<dc:creator>Amy</dc:creator>
		<pubDate>Fri, 23 Apr 2010 05:29:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1658</guid>
		<description>Thanks for the clear and detailed explanation!</description>
		<content:encoded><![CDATA[<p>Thanks for the clear and detailed explanation!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1154</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Thu, 25 Feb 2010 02:27:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1154</guid>
		<description>Hi Jonathan

Do you have an example of what you&#039;re trying to achieve?

From my example above I could extend the object created in the web service to have a list of skills for each customer. I could then do the following to iterate through each customer and their skills:

[html]
&lt;ul&gt;
    {#foreach $T as Customer}
        &lt;li&gt;
            { $T.Customer.Forename } { $T.Customer.Surname }
            
            &lt;ul&gt;
                {#foreach $T.Customer.Skills as Skill}
                    &lt;li&gt; { $T.Skill.Name } ({ $T.Customer.Location }) &lt;/li&gt;
                {#/for}
            &lt;/ul&gt;
        &lt;/li&gt;
    {#/for}
&lt;/ul&gt;

[/html]

In the inner for loop I an using the current iteration of the outer for loop to display the location with each skill (doesn&#039;t really make sense to do this but just as an example).

Is this what you mean?

Joe</description>
		<content:encoded><![CDATA[<p>Hi Jonathan</p>
<p>Do you have an example of what you&#8217;re trying to achieve?</p>
<p>From my example above I could extend the object created in the web service to have a list of skills for each customer. I could then do the following to iterate through each customer and their skills:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul&gt;
    {#foreach $T as Customer}
        &lt;li&gt;
            { $T.Customer.Forename } { $T.Customer.Surname }

            &lt;ul&gt;
                {#foreach $T.Customer.Skills as Skill}
                    &lt;li&gt; { $T.Skill.Name } ({ $T.Customer.Location }) &lt;/li&gt;
                {#/for}
            &lt;/ul&gt;
        &lt;/li&gt;
    {#/for}
&lt;/ul&gt;
</pre>
<p>In the inner for loop I an using the current iteration of the outer for loop to display the location with each skill (doesn&#8217;t really make sense to do this but just as an example).</p>
<p>Is this what you mean?</p>
<p>Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1148</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Wed, 24 Feb 2010 10:10:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1148</guid>
		<description>Hi Joe

Not sure if you could help but I figure why not ask and see what happens.

I&#039;ve used the templates for a while. I currently have a for loop within a for loop.

I&#039;m trying to access a value from the outer for loop within the inner for loop. Don&#039;t suppose you know how to do this?

Thanks
Jon</description>
		<content:encoded><![CDATA[<p>Hi Joe</p>
<p>Not sure if you could help but I figure why not ask and see what happens.</p>
<p>I&#8217;ve used the templates for a while. I currently have a for loop within a for loop.</p>
<p>I&#8217;m trying to access a value from the outer for loop within the inner for loop. Don&#8217;t suppose you know how to do this?</p>
<p>Thanks<br />
Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1135</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 22 Feb 2010 22:47:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1135</guid>
		<description>Hi David

Glad you found it useful, it&#039;s pretty cool.

I also did a post where I did inline table editing using jTemplates. It&#039;s not the greatest as it does an ajax update for every field changed but it shows how easy it can be.

Only been here in Sydney for 12 months myself but can&#039;t see myself heading back to the UK any time soon.

Joe</description>
		<content:encoded><![CDATA[<p>Hi David</p>
<p>Glad you found it useful, it&#8217;s pretty cool.</p>
<p>I also did a post where I did inline table editing using jTemplates. It&#8217;s not the greatest as it does an ajax update for every field changed but it shows how easy it can be.</p>
<p>Only been here in Sydney for 12 months myself but can&#8217;t see myself heading back to the UK any time soon.</p>
<p>Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Sheardown</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1123</link>
		<dc:creator>David Sheardown</dc:creator>
		<pubDate>Sun, 21 Feb 2010 08:28:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1123</guid>
		<description>Hi there... well I too am a native of old Blighty.. up Lincoln way, although been here in Oz for 12 years.. 

Thanks for this! I was really trying to find an easy way to present data that is looped... ie.. foreach.  I have a mechanism already that auto-maps database fields direct to HTML elements (i.e. single values), but again I needed something easy to present repeating items.

Thanks very much.. for once a clear easy to follow example... that actually explains the whole process!</description>
		<content:encoded><![CDATA[<p>Hi there&#8230; well I too am a native of old Blighty.. up Lincoln way, although been here in Oz for 12 years.. </p>
<p>Thanks for this! I was really trying to find an easy way to present data that is looped&#8230; ie.. foreach.  I have a mechanism already that auto-maps database fields direct to HTML elements (i.e. single values), but again I needed something easy to present repeating items.</p>
<p>Thanks very much.. for once a clear easy to follow example&#8230; that actually explains the whole process!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1066</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 16 Feb 2010 05:44:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1066</guid>
		<description>Hi Sean

Glad you found it useful

Joe</description>
		<content:encoded><![CDATA[<p>Hi Sean</p>
<p>Glad you found it useful</p>
<p>Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.joe-stevens.com/2010/01/05/using-the-jtemplate-jquery-plugin-with-ajax-and-asp-net/comment-page-1/#comment-1065</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Mon, 15 Feb 2010 22:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.joe-stevens.com/?p=367#comment-1065</guid>
		<description>Thanks for the clear and detailed explanation!</description>
		<content:encoded><![CDATA[<p>Thanks for the clear and detailed explanation!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

