<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andrey Shchekin &#187; AJAX</title>
	<atom:link href="http://blog.ashmind.com/index.php/category/web/web-20/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ashmind.com</link>
	<description></description>
	<lastBuildDate>Mon, 15 Mar 2010 18:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Client-side databinding with ASP.Net AJAX Futures</title>
		<link>http://blog.ashmind.com/2007/06/21/client-side-databinding-with-aspnet-ajax-futures/</link>
		<comments>http://blog.ashmind.com/2007/06/21/client-side-databinding-with-aspnet-ajax-futures/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 22:29:52 +0000</pubDate>
		<dc:creator>Andrey Shchekin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[DataBinding]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.ashmind.com/index.php/2007/06/21/client-side-databinding-with-aspnet-ajax-futures/</guid>
		<description><![CDATA[Recently I got an optimization problem in ASP.Net.To be short, I had a Repeater with custom (somewhat complex) template on my Page, and I wanted to reload it asynchronously. The first solution was XP and didin&#8217;t consider performance at all: wrap Repeater inside an UpdatePanel.The problem was that the entire Page had to be repopulated [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I got an optimization problem in ASP.Net.<br />To be short, I had a Repeater with custom (somewhat complex) template on my Page, and I wanted to reload it asynchronously.</p>
<p>The first solution was XP and didin&#8217;t consider performance at all: wrap Repeater inside an UpdatePanel.<br />The problem was that the entire Page had to be repopulated on server just to get to the Repeater.</p>
<p>That gave me a choice of two headaches: </p>
<ol>
<li>Put all Page/Controls data into ViewState and bloat bandwidth.
<li>Query all additional data on the reload request and increase load on database to get data that will be thrown away. </li>
</ol>
<p>To be honest, I could solve (2) with server-side cache, but, in my opinion, caching does not make ugly solutions any better, just faster. </p>
<p>So, naturally, my thought was to query the data-only WebService and then populate the Repeater on client.</p>
<p>And it was interesting to find out that Microsoft already has a client-side data binding solution within ASP.Net AJAX Futures.<br />I have found an excellent article on this matter by Xianzhong Zhu, &#8220;Unveil the Data Binding Architecture inside Microsoft ASP.NET Ajax 1.0&#8243; (<a href="http://aspalliance.com/1301_Unveil_the_Data_Binding_Architecture_inside_Microsoft_ASPNET_Ajax_10__Part_1">Part 1</a>, <a href="http://aspalliance.com/1301_Unveil_the_Data_Binding_Architecture_inside_Microsoft_ASPNET_Ajax_10__Part_2">Part 2</a>).</p>
<p>I will now&nbsp;give a quick summary on the overall client-side binding architecture.<br />In essence it is quite similar to the smart DataSource controls of ASP.Net 2.0:<br />There is a DataSource javascript component and a ListView javascript control with html template.<br />ListView passes data from/to DataSource control, and DataSource talks with a JSON Web Service as a backend.<br />Controls and their relations&nbsp;are described in <a href="http://www.nikhilk.net/AtlasXMLScript.aspx">text/xml-script</a> (Futures-only feature).</p>
<p>Everything seems quite straightforward and easy to use, I was quite happy to find it.<br />One thing that bothers me is the performance of text/xml-script (it is parsed on client).<br />But it is a concern not related to the current story.<br />The other question is what to do when I want to databind a complex&nbsp;list (consisting of several embedded server user controls) ?<br />I am going to find it out real soon.</p>
<p>Along the way,&nbsp;I have also&nbsp;noticed&nbsp;Sys.Preview.Data also introduces DataSets/DataTables to javascript.<br />That is quite funny.&nbsp;Personally, I&nbsp;never really considered DataSets acceptable anywhere above Persistence layer.<br />But I already thought about Persistence/DataAccess concept in javascript when I saw <a href="http://gears.google.com/">Gears</a>.<br />And DataSets seem to fit &#8216;nicely&#8217; to some&nbsp;GoogleGearsDataSource (it would be quite an experience to actually see one in real code).</p>
<p>Well, javascript O/R Mapper, anyone ?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashmind.com/2007/06/21/client-side-databinding-with-aspnet-ajax-futures/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
