<?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: Are you making these 3 common ASP.NET AJAX mistakes?</title>
	<atom:link href="http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/feed/" rel="self" type="application/rss+xml" />
	<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/</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: Mohsen</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-62306</link>
		<dc:creator>Mohsen</dc:creator>
		<pubDate>Sun, 22 Jan 2012 10:30:01 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-62306</guid>
		<description>hi,
i have a &quot;protected void Page_Unload(object sender, EventArgs e)&quot; and i want fire it when user close or redirect to other pages, but i have updatepanel too that is updated with a timer every 3s and it is firing my  &quot;protected void Page_Unload(object sender, EventArgs e)&quot;, i use &quot;if (!IsPostBack)&quot; but it didnot do what i want.
how can i do that.
sorry for my bad english, thx.</description>
		<content:encoded><![CDATA[<p>hi,<br />
i have a &#8220;protected void Page_Unload(object sender, EventArgs e)&#8221; and i want fire it when user close or redirect to other pages, but i have updatepanel too that is updated with a timer every 3s and it is firing my  &#8220;protected void Page_Unload(object sender, EventArgs e)&#8221;, i use &#8220;if (!IsPostBack)&#8221; but it didnot do what i want.<br />
how can i do that.<br />
sorry for my bad english, thx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sara</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-44960</link>
		<dc:creator>Sara</dc:creator>
		<pubDate>Tue, 23 Aug 2011 11:51:09 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-44960</guid>
		<description>You have no idea how much you helped me!
I made almost every mistake you metioned there...</description>
		<content:encoded><![CDATA[<p>You have no idea how much you helped me!<br />
I made almost every mistake you metioned there&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Barnard. Iterations. &#187; Blog Archive &#187; ASP.NET Webforms Page Life Cycle&#8211;The Basics</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-43362</link>
		<dc:creator>Eric Barnard. Iterations. &#187; Blog Archive &#187; ASP.NET Webforms Page Life Cycle&#8211;The Basics</dc:creator>
		<pubDate>Mon, 16 May 2011 01:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-43362</guid>
		<description>[...] http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/" rel="nofollow">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-43296</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Sun, 01 May 2011 12:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-43296</guid>
		<description>I don&#039;t mean to be a jerk, this post is great and useful, but from a design perspective it doesn&#039;t make too much sense to me why an ajax call would cause asp.net to fully reinstantiated the Page&#039;s control tree and every single control run through its life cycle events (other than providing a familiar - but architecturally illogical api)?? 

Now that you&#039;ve told me I can live with it, and fair enough you have the Page.isPostBack &amp; ScriptManager.IsInAsyncPostBack set to true... it&#039;s all good.

But consider this scenario:

-) I have a user control that gets automatically generated on page load, many times (I only want them generated once).

-) On each user-control I want ajax to send some user-control data (collected in a form) back to the server (so it can be written to a DB). You can probably already see, that since user-controls were added dynamically, I have to store them somewhere in view state and retrieve them for display with evert ajax update-panel call, since otherwise the page loads-up blank without these controls.

-) This in my opinion is a lot of cost for using the abstraction advantage of the update-panel. Isn&#039;t ajax all about not having to re-create / re-load all the elements other than the ones that are necessary?

-) ... and finally let&#039;s assume that all my user control needs to do is just to store the few data-items from a form on the user-control to the db, and no manipulation of HTML on the client is really necessary. In that case the update-panel is just a huuuge overkill... much better to simply write some Jquery AJAX code to get the data-items on client side and send them to the server, no need then to worry about saving and re-loading ddynamically generate user controls!

Any feedback would be welcome, what do you guys think?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t mean to be a jerk, this post is great and useful, but from a design perspective it doesn&#8217;t make too much sense to me why an ajax call would cause asp.net to fully reinstantiated the Page&#8217;s control tree and every single control run through its life cycle events (other than providing a familiar &#8211; but architecturally illogical api)?? </p>
<p>Now that you&#8217;ve told me I can live with it, and fair enough you have the Page.isPostBack &amp; ScriptManager.IsInAsyncPostBack set to true&#8230; it&#8217;s all good.</p>
<p>But consider this scenario:</p>
<p>-) I have a user control that gets automatically generated on page load, many times (I only want them generated once).</p>
<p>-) On each user-control I want ajax to send some user-control data (collected in a form) back to the server (so it can be written to a DB). You can probably already see, that since user-controls were added dynamically, I have to store them somewhere in view state and retrieve them for display with evert ajax update-panel call, since otherwise the page loads-up blank without these controls.</p>
<p>-) This in my opinion is a lot of cost for using the abstraction advantage of the update-panel. Isn&#8217;t ajax all about not having to re-create / re-load all the elements other than the ones that are necessary?</p>
<p>-) &#8230; and finally let&#8217;s assume that all my user control needs to do is just to store the few data-items from a form on the user-control to the db, and no manipulation of HTML on the client is really necessary. In that case the update-panel is just a huuuge overkill&#8230; much better to simply write some Jquery AJAX code to get the data-items on client side and send them to the server, no need then to worry about saving and re-loading ddynamically generate user controls!</p>
<p>Any feedback would be welcome, what do you guys think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SharePoint Google Geospacial Dashboard Solution &#8211; Lessons Learned &#171; Sue Hernandez&#039;s Blog</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41698</link>
		<dc:creator>SharePoint Google Geospacial Dashboard Solution &#8211; Lessons Learned &#171; Sue Hernandez&#039;s Blog</dc:creator>
		<pubDate>Wed, 12 Jan 2011 23:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41698</guid>
		<description>[...] The first problem I had, though, was I kept losing my instance of the class.  So I found out here (http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/) that I was making the common newbie mistake &#8211; I didn&#8217;t know the async postback was [...]</description>
		<content:encoded><![CDATA[<p>[...] The first problem I had, though, was I kept losing my instance of the class.  So I found out here (<a href="http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/" rel="nofollow">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/</a>) that I was making the common newbie mistake &#8211; I didn&#8217;t know the async postback was [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Improve ASP.NET UpdatePanel Performance &#171; Er. alokpandey&#039;s Blog</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41656</link>
		<dc:creator>How to Improve ASP.NET UpdatePanel Performance &#171; Er. alokpandey&#039;s Blog</dc:creator>
		<pubDate>Wed, 05 Jan 2011 04:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41656</guid>
		<description>[...] but those mentioned above have been proven by real experience. I would also recommend reading an excellent post by Dave Ward that helps in understanding how UpdatePanel works behind the scenes and never [...]</description>
		<content:encoded><![CDATA[<p>[...] but those mentioned above have been proven by real experience. I would also recommend reading an excellent post by Dave Ward that helps in understanding how UpdatePanel works behind the scenes and never [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Haiman</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41573</link>
		<dc:creator>Steve Haiman</dc:creator>
		<pubDate>Tue, 21 Dec 2010 22:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41573</guid>
		<description>Correction... I do not place this on the onit event, only on the prerender.  All of my custom controls that have an update panel either cache their drop down list values, and the actual data binding events that happen in the update panels are called from pre-render.  By using the code I posted I only pre-render the controls I want to update.  By the way this works as well for controls without the update panels that are on this same page obviously.  THe only tricky part is if you are intending on repurposing the controls you may run into an issue.</description>
		<content:encoded><![CDATA[<p>Correction&#8230; I do not place this on the onit event, only on the prerender.  All of my custom controls that have an update panel either cache their drop down list values, and the actual data binding events that happen in the update panels are called from pre-render.  By using the code I posted I only pre-render the controls I want to update.  By the way this works as well for controls without the update panels that are on this same page obviously.  THe only tricky part is if you are intending on repurposing the controls you may run into an issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Haiman</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41572</link>
		<dc:creator>Steve Haiman</dc:creator>
		<pubDate>Tue, 21 Dec 2010 21:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41572</guid>
		<description>In my situation I solved the problem with the following code placed at the oninit and prerender.  My situation is that I use master page and a number of custom controls some of which have update panels.  On one page I have 3 update panels, and by using this code at oninit and prerender I only fire the update panels I want.

bool isAsynch = ((ScriptManager)this.Page.Master.FindControl(&quot;MasterScriptManager&quot;)).IsInAsyncPostBack;
                        if (HttpContext.Current.Request[&quot;__EVENTTARGET&quot;] != null)
                        {
                            if (!HttpContext.Current.Request[&quot;__EVENTTARGET&quot;].Contains(&quot;NAME OF MY CONTROL THAT FIRED THE UPDATE&quot;) &amp;&amp; isAsynch)
                            {
                                return;
                            }
                        }

For instance if I have a dropdownlist where the change event fires the update, I simply have to check for the name of the control and either allow the processing to continue or stop immediately.</description>
		<content:encoded><![CDATA[<p>In my situation I solved the problem with the following code placed at the oninit and prerender.  My situation is that I use master page and a number of custom controls some of which have update panels.  On one page I have 3 update panels, and by using this code at oninit and prerender I only fire the update panels I want.</p>
<p>bool isAsynch = ((ScriptManager)this.Page.Master.FindControl(&#8220;MasterScriptManager&#8221;)).IsInAsyncPostBack;<br />
                        if (HttpContext.Current.Request["__EVENTTARGET"] != null)<br />
                        {<br />
                            if (!HttpContext.Current.Request["__EVENTTARGET"].Contains(&#8220;NAME OF MY CONTROL THAT FIRED THE UPDATE&#8221;) &amp;&amp; isAsynch)<br />
                            {<br />
                                return;<br />
                            }<br />
                        }</p>
<p>For instance if I have a dropdownlist where the change event fires the update, I simply have to check for the name of the control and either allow the processing to continue or stop immediately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uday Ramayanam</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41094</link>
		<dc:creator>Uday Ramayanam</dc:creator>
		<pubDate>Sun, 12 Dec 2010 22:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41094</guid>
		<description>Thank You. This is exactly what I am looking for. You are the best.</description>
		<content:encoded><![CDATA[<p>Thank You. This is exactly what I am looking for. You are the best.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41093</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Sun, 12 Dec 2010 22:50:24 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41093</guid>
		<description>I&#039;ve got a couple of posts here covering how to use jQuery Validation with WebForms, starting here: http://encosia.com/2009/11/04/using-jquery-validation-with-asp-net-webforms/</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got a couple of posts here covering how to use jQuery Validation with WebForms, starting here: <a href="http://encosia.com/2009/11/04/using-jquery-validation-with-asp-net-webforms/" rel="nofollow">http://encosia.com/2009/11/04/using-jquery-validation-with-asp-net-webforms/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uday Ramayanam</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41091</link>
		<dc:creator>Uday Ramayanam</dc:creator>
		<pubDate>Sun, 12 Dec 2010 22:30:46 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41091</guid>
		<description>Thank You Dave for your reply. I figured out that the ASP validator in one of the div tags is causing the problem. Btw, your article on 3 common ajax mistakes is awesome and very informative. Also I have another question. Do Jquery validations work in the update panel?</description>
		<content:encoded><![CDATA[<p>Thank You Dave for your reply. I figured out that the ASP validator in one of the div tags is causing the problem. Btw, your article on 3 common ajax mistakes is awesome and very informative. Also I have another question. Do Jquery validations work in the update panel?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41088</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Sun, 12 Dec 2010 20:56:20 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41088</guid>
		<description>Make sure those buttons are set as async triggers of the UpdatePanel.</description>
		<content:encoded><![CDATA[<p>Make sure those buttons are set as async triggers of the UpdatePanel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uday</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41074</link>
		<dc:creator>Uday</dc:creator>
		<pubDate>Sun, 12 Dec 2010 00:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-41074</guid>
		<description>I have run in to a problem on which i have spent hours.
I have two divs with an update panel.  and I want to toggle the display on a button clicks. The event is fired and the code the executed but my update panel wont update. But &quot;onselectedindexchanged&quot; event for my dropdown works fine.

I know my question sound silly. Any suggestion is highly appreciated</description>
		<content:encoded><![CDATA[<p>I have run in to a problem on which i have spent hours.<br />
I have two divs with an update panel.  and I want to toggle the display on a button clicks. The event is fired and the code the executed but my update panel wont update. But &#8220;onselectedindexchanged&#8221; event for my dropdown works fine.</p>
<p>I know my question sound silly. Any suggestion is highly appreciated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jichao Zhong</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-40964</link>
		<dc:creator>Jichao Zhong</dc:creator>
		<pubDate>Wed, 08 Dec 2010 17:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-40964</guid>
		<description>Actually I don&#039;t like to post comments on websites, but your PreRender suggestion is amazing. Thank you very very much.</description>
		<content:encoded><![CDATA[<p>Actually I don&#8217;t like to post comments on websites, but your PreRender suggestion is amazing. Thank you very very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Are you making these 3 common ASP.NET AJAX mistakes? : MS-Joe</title>
		<link>http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-40051</link>
		<dc:creator>Are you making these 3 common ASP.NET AJAX mistakes? : MS-Joe</dc:creator>
		<pubDate>Sat, 09 Oct 2010 14:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/#comment-40051</guid>
		<description>[...] Check out Dave Wards advice on Update Panels and Postabacks at Encosia HERE. [...]</description>
		<content:encoded><![CDATA[<p>[...] Check out Dave Wards advice on Update Panels and Postabacks at Encosia HERE. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

