<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>.BenRush</title>
    <link>http://www.ben-rush.net/blog/</link>
    <description>Exploring the depths and potentials of ASP.NET</description>
    <language>en-us</language>
    <copyright>Benjamin Rush</copyright>
    <lastBuildDate>Mon, 27 Aug 2007 19:16:29 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.7174.0</generator>
    <managingEditor>ben@sideshowsystems.com</managingEditor>
    <webMaster>ben@sideshowsystems.com</webMaster>
    <geo:lat>40.785557</geo:lat><geo:long>-96.645994</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/benrush" type="application/rss+xml" /><feedburner:emailServiceId>benrush</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=ab06173a-0ba8-4ebc-bc27-26a780888005</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,ab06173a-0ba8-4ebc-bc27-26a780888005.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,ab06173a-0ba8-4ebc-bc27-26a780888005.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ab06173a-0ba8-4ebc-bc27-26a780888005</wfw:commentRss>
      
      <title>Hacker attempts</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,ab06173a-0ba8-4ebc-bc27-26a780888005.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/fyKOTBLPp_8/PermaLink,guid,ab06173a-0ba8-4ebc-bc27-26a780888005.aspx</link>
      <pubDate>Mon, 27 Aug 2007 19:16:29 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
My main server appears to be under some sort of attack (I just noticed it this morning)&#xD;
so I'm going to be doing some maintenance on the machine to make sure things stay&#xD;
up and stable. Just a heads up that the server may go offline for a bit. &#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=ab06173a-0ba8-4ebc-bc27-26a780888005"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=fyKOTBLPp_8:xz9s7bTjSG0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=fyKOTBLPp_8:xz9s7bTjSG0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=fyKOTBLPp_8:xz9s7bTjSG0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=fyKOTBLPp_8:xz9s7bTjSG0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=fyKOTBLPp_8:xz9s7bTjSG0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=fyKOTBLPp_8:xz9s7bTjSG0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/fyKOTBLPp_8" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,ab06173a-0ba8-4ebc-bc27-26a780888005.aspx</comments>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,ab06173a-0ba8-4ebc-bc27-26a780888005.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=7116cb04-2ab7-44fd-a95d-ccf2bd4b4182</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,7116cb04-2ab7-44fd-a95d-ccf2bd4b4182.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,7116cb04-2ab7-44fd-a95d-ccf2bd4b4182.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7116cb04-2ab7-44fd-a95d-ccf2bd4b4182</wfw:commentRss>
      <slash:comments>4</slash:comments>
      
      <title>Calling web services from ASP.NET AJAX</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,7116cb04-2ab7-44fd-a95d-ccf2bd4b4182.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/4XMf_opjibk/PermaLink,guid,7116cb04-2ab7-44fd-a95d-ccf2bd4b4182.aspx</link>
      <pubDate>Wed, 22 Aug 2007 05:46:33 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I don't know if you've ever tried calling a web service from client script before,&#xD;
but with ASP.NET AJAX it's amazingly simple. In fact, a great deal of the built-in&#xD;
features (such as authentication, my next topic) of ASP.NET AJAX are accomplished&#xD;
through the web services infrastructure inherent to ASP.NET AJAX. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
However, there are plenty out there who may never have attempted to call a web service&#xD;
from client script, instead always accomplishing their task with their ASPX pages&#xD;
either through a synchronous or asynchronous page requests. Yet, there are many good&#xD;
reasons to execute a web service from your client script: &#xD;
&lt;/p&gt;&#xD;
        &lt;ol&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Responsiveness&lt;/strong&gt;: To render an ASP.NET web page (even one through ASP.NET&#xD;
AJAX) still takes a fair amount of server resources. A great number of controls still&#xD;
must be rendered out and the entire page lifecycle must be executed in order for the&#xD;
response to be generated back to the client. If you want a simple bit of information,&#xD;
why put the strain on your server when you can simply call a basic web service instead? &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Coding Simplicity&lt;/strong&gt;: Sometimes a web service simply makes more sense&#xD;
than calling a web page. For example, what if you wanted to update a stock ticker&#xD;
on your web page with fresh content every ten seconds. Rather than calling back to&#xD;
the server to process a page that must magically return content that seamlessly updates&#xD;
the stock ticker, the ticker can simply call a web service from the browser and update&#xD;
itself through the browser DOM. &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Cleanliness&lt;/strong&gt;: Asynchronous behavior is cleaner in a web browser than&#xD;
a full post-back, and a web service, with less data, requires less time to process&#xD;
and will therefore typically return to the client faster. &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Reuse&lt;/strong&gt;: A web service can be reused many, many times over by many,&#xD;
many different clients. Whether you're writing a desktop application, a script application&#xD;
that runs in your browser, or a legacy UNIX-based mainframe application that leverages&#xD;
pure socket-based programming, one web-service can "service" them all. If you are&#xD;
in the business of implementing stock tickers in web pages, then it makes sense you're&#xD;
likely to use that same application code in other areas; building it as a web-service&#xD;
simplifies the matter (and now that you can easily call it from script code, there's&#xD;
no reason for clumsy shared libraries, etc). &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Mashupability&lt;/strong&gt;: Mashups are the way of the future - at least for the&#xD;
next year or so until the next way of the future hits the web. A web-service front-end&#xD;
lends itself to mashable behavior much more than some heavy ASPX page. Making your&#xD;
components interact with script increases their overall exposure by allowing them&#xD;
to partake in the new Web 2.0 atmosphere (plus it looks good to your boss too). &#xD;
&lt;/li&gt;&#xD;
        &lt;/ol&gt;&#xD;
        &lt;p&gt;&#xD;
Honestly the list could go on and on. I'm sure if you sat and thought you could list&#xD;
off any number of other reasons why updating components on your page using the asynchronous,&#xD;
relatively light-weight nature of web services (at least more so than ASPX pages)&#xD;
wins out over synchronous and asynchronous page-refreshes. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
In ASP.NET AJAX it's also wicked simple. The steps are as follows: &#xD;
&lt;/p&gt;&#xD;
        &lt;ol&gt;&#xD;
          &lt;li&gt;&#xD;
Create a web service, &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Register said web service with the ScriptManager on the ASPX page, &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Call the auto-generated script wrappers for the service and consume the response from&#xD;
the service as properly-typed JavaScript. &#xD;
&lt;/li&gt;&#xD;
        &lt;/ol&gt;&#xD;
        &lt;p&gt;&#xD;
I'm going to shamelessly steal the &lt;a href="http://asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx"&gt;example&#xD;
code from the ASP.NET AJAX sample&lt;/a&gt; on using web services for this post because&#xD;
it's about as simple as it gets. So, &lt;strong&gt;first we create our web service&lt;/strong&gt;: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/11234567.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
....note the use of the [ScriptService] attribute, this is a must...&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Next, &lt;strong&gt;we simply register the service address with the ScriptManager&lt;/strong&gt; that&#xD;
we already have existing on our ASPX page: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/212345.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
And then we simply &lt;strong&gt;call an auto-generated script method&lt;/strong&gt; (scoped the&#xD;
same as the class of the web service method): &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/312345.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
To you, the developer, the script method magically appears on the client, ready to&#xD;
use. But, we all know it wasn't magical and there was a great deal of cool work under&#xD;
the hood to make all of this come to life. Just how this works, and how you can leverage&#xD;
it best in your applications, will follow over the next couple days.....&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=7116cb04-2ab7-44fd-a95d-ccf2bd4b4182"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=4XMf_opjibk:0SoNtvKDAC4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=4XMf_opjibk:0SoNtvKDAC4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=4XMf_opjibk:0SoNtvKDAC4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=4XMf_opjibk:0SoNtvKDAC4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=4XMf_opjibk:0SoNtvKDAC4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=4XMf_opjibk:0SoNtvKDAC4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/4XMf_opjibk" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,7116cb04-2ab7-44fd-a95d-ccf2bd4b4182.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
      <category>JavaScript</category>
      <category>Web 2.0</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,7116cb04-2ab7-44fd-a95d-ccf2bd4b4182.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb</wfw:commentRss>
      
      <title>The next topic....Authentication in ASP.NET AJAX</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/WX8fFpk3H90/PermaLink,guid,ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb.aspx</link>
      <pubDate>Tue, 21 Aug 2007 19:24:02 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I'm preparing to write a number of posts over the next week or two on the topic of&#xD;
authentication in ASP.NET AJAX; again going under the hood and exploring how the internals&#xD;
work as well as showing you all of the features of authentication (and how to best&#xD;
leverage it in your applications). I should have a post ready by tonight on the topic,&#xD;
but if you have any particular interests in this area feel free to comment on this&#xD;
post and I'll make sure to bring up your topic in this or the next couple articles. &#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WX8fFpk3H90:D_Na0G3ebwI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WX8fFpk3H90:D_Na0G3ebwI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=WX8fFpk3H90:D_Na0G3ebwI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WX8fFpk3H90:D_Na0G3ebwI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WX8fFpk3H90:D_Na0G3ebwI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=WX8fFpk3H90:D_Na0G3ebwI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/WX8fFpk3H90" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,ee81c6eb-c911-4c4d-a35a-2228a9c0dfdb.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=0173a36c-e225-4380-86b5-1e92794bd173</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,0173a36c-e225-4380-86b5-1e92794bd173.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,0173a36c-e225-4380-86b5-1e92794bd173.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0173a36c-e225-4380-86b5-1e92794bd173</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>Using the UpdatePanelAnimationExtender to run script when an UpdatePanel updates/refreshes</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,0173a36c-e225-4380-86b5-1e92794bd173.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/zrDJZYfh2Bs/PermaLink,guid,0173a36c-e225-4380-86b5-1e92794bd173.aspx</link>
      <pubDate>Thu, 16 Aug 2007 15:52:19 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The &lt;a href="http://asp.net/ajax/control-toolkit/live/UpdatePanelAnimation/UpdatePanelAnimation.aspx"&gt;UpdatePanelAnimationExtender&lt;/a&gt; is
an interesting and useful extender control found in the ASP.NET AJAX Control Toolkit
that enables you to run animations when an UpdatePanel control updates or has finished
updating on the client. The &lt;a href="http://asp.net/ajax/control-toolkit/live/UpdatePanelAnimation/UpdatePanelAnimation.aspx"&gt;sample
on the control toolkit website&lt;/a&gt; shows how you can animate the UpdatePanel when
it updates by leveraging the extender control. &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;However,
because the Animation framework is quite extensive, you can also do many interesting
things to controls outside of the UpdatePanel when it updates by leveraging a bit
of JavaScript and the &lt;a href="http://asp.net/ajax/control-toolkit/live/UpdatePanelAnimation/UpdatePanelAnimation.aspx"&gt;UpdatePanelAnimationExtender&lt;/a&gt;.
This is possible without the UpUpdatePanelAnimationExtender, but by using it you can
accomplish scripting in a much cleaner and manageable manner. For example, say I wanted
to disable a button outside of my UpdatePanel when the panel updates: &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;img src="http://www.ben-rush.net/blog/content/binary/1123456.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;
&lt;v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;
&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;
&lt;v:formulas&gt;
&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;
&lt;/v:formulas&gt;
&lt;v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"&gt;&lt;/v:path&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:lock v:ext="edit" aspectratio="t"&gt;&lt;/o:lock&gt;
&lt;/v:shapetype&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;To
do this with the UpdatePanelAnimationExtender is trivial, you simply add the Extender
to your page: &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;img src="http://www.ben-rush.net/blog/content/binary/21234.jpg" border=0&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Note
that it has an Animations sub-element; this is where you place the Animations you
want ran when the UpdatePanel updates or has finished updating (OnUpdating and OnUpdated
respectively).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Now, you can add any animations
under the event nodes, but I want to add some script to disable the button and re-enable
it when the UpdatePanel has finished refreshing: &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;img src="http://www.ben-rush.net/blog/content/binary/31234.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Now
your script is clearly and concisely placed within Animation event framework where
you can make it invisible, disabled, etc. To me this is a much nicer solution than
writing script directly into the page output. &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=0173a36c-e225-4380-86b5-1e92794bd173" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=zrDJZYfh2Bs:LMzshXzhB4M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=zrDJZYfh2Bs:LMzshXzhB4M:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=zrDJZYfh2Bs:LMzshXzhB4M:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=zrDJZYfh2Bs:LMzshXzhB4M:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=zrDJZYfh2Bs:LMzshXzhB4M:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=zrDJZYfh2Bs:LMzshXzhB4M:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/zrDJZYfh2Bs" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,0173a36c-e225-4380-86b5-1e92794bd173.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
      <category>JavaScript</category>
      <category>Web 2.0</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,0173a36c-e225-4380-86b5-1e92794bd173.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=d0f2e19d-d2ef-4b9c-833b-81353e84a1c3</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,d0f2e19d-d2ef-4b9c-833b-81353e84a1c3.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,d0f2e19d-d2ef-4b9c-833b-81353e84a1c3.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d0f2e19d-d2ef-4b9c-833b-81353e84a1c3</wfw:commentRss>
      
      <title>(OT) Google's algorithms still not perfect</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,d0f2e19d-d2ef-4b9c-833b-81353e84a1c3.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/kkpKvntieU8/PermaLink,guid,d0f2e19d-d2ef-4b9c-833b-81353e84a1c3.aspx</link>
      <pubDate>Mon, 13 Aug 2007 17:28:24 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Today, as I was browsing Google News, I stumbled across a heading/image pair that&#xD;
didn't quite seem to match well: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/Untitled.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
....I would really hate to encounter those "South Bay authorities" in a dark alley&#xD;
somewhere....&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=d0f2e19d-d2ef-4b9c-833b-81353e84a1c3"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=kkpKvntieU8:XvXD5rP5KsU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=kkpKvntieU8:XvXD5rP5KsU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=kkpKvntieU8:XvXD5rP5KsU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=kkpKvntieU8:XvXD5rP5KsU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=kkpKvntieU8:XvXD5rP5KsU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=kkpKvntieU8:XvXD5rP5KsU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/kkpKvntieU8" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,d0f2e19d-d2ef-4b9c-833b-81353e84a1c3.aspx</comments>
      <category>Ranting</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,d0f2e19d-d2ef-4b9c-833b-81353e84a1c3.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=70870288-191a-4dd0-a1a0-61365a26dea1</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,70870288-191a-4dd0-a1a0-61365a26dea1.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,70870288-191a-4dd0-a1a0-61365a26dea1.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=70870288-191a-4dd0-a1a0-61365a26dea1</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>Another (possible) way to reference script objects from the client page</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,70870288-191a-4dd0-a1a0-61365a26dea1.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/BoUiybCQJG0/PermaLink,guid,70870288-191a-4dd0-a1a0-61365a26dea1.aspx</link>
      <pubDate>Mon, 13 Aug 2007 17:02:37 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
So, I got to reading a couple blog posts this weekend and &lt;a href="http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/"&gt;one&#xD;
of them&lt;/a&gt; (which I found from &lt;a href="http://www.dotnetkicks.com/"&gt;dotnetkicks.com&lt;/a&gt;)&#xD;
was interesting. It presented a problem that I've encountered before but always skirted&#xD;
architecturally (I just changed the design of my web application a bit so I wasn't&#xD;
faced with it anymore). I got to thinking about a few ways to solve this issue and&#xD;
one way popped out at me as one way - but not necessarily the best way (possibly not&#xD;
even close, in certain circumstances). Anyway, I'm presenting it here to open the&#xD;
discussion up if anyone wishes, but otherwise to just write it down so that I have&#xD;
it here for later reference. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;The Problem&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
You cannot easily reference objects from client script if their server-side counterparts&#xD;
are housed within certain parent controls. For example, if you place a TextBox&#xD;
control within a Wizard control and then attempt to reference that TextBox control&#xD;
from client script, you will undoubtedly have difficulties. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;Why?&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
When the control is rendered out to the browser, it's client-side ClientID will not&#xD;
be the same as it's server side ClientID for various reasons. Suffice it to say that&#xD;
if you name a TextBox "MyTextBox", place it within a Wizard control, and then attempt&#xD;
to reference that control from client script with the ID "MyTextBox" it will fail&#xD;
(for the sake of posterity, the name of the TextBox will probably be the name of the&#xD;
wizard + underscore + "MyTextBox"). &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
This is obviously a problem if you're writing script to reference objects through&#xD;
the $get() shortcut handler, etc. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;One Solution&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
One solution is to not use ID as the reference attribute, but to instead add some&#xD;
other attribute and reference controls that way. Now, I'm not sure how browser-compliant&#xD;
this nor how standards compliant it is, but it works for me locally and I thought&#xD;
I'd at least mention it for those who may be on their last leg trying to back out&#xD;
of a problem like this. I just picked a random attribute name "googliebah" and decorated&#xD;
a couple controls on my page with it; then my custom script will locate a control&#xD;
with the googliebah ID and then determine if its value matched the search value. Obviously&#xD;
it works. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Now, in terms of efficiency I can't say this ranks as a an optimal solution; but perhaps&#xD;
a more eager person could introduce some level of caching the elements once they're&#xD;
found (or limiting the scope of the objects you're searching by doing some post-processing&#xD;
on the ASP.NET page). I have a few ideas around that solution, but I can't say as&#xD;
though I have the time at the moment to implement them. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Regardless, this is the script: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;        &amp;lt;script type="text/javascript"&amp;gt;&lt;br&gt;&#xD;
            function newFind(name)&lt;br&gt;&#xD;
            {&lt;br&gt;&#xD;
               &#xD;
var elems = document.getElementsByTagName('*'); &#xD;
&lt;br&gt;&#xD;
               &#xD;
var num = elems.length; &#xD;
&lt;br&gt;&#xD;
               &#xD;
for(var c=0;c&amp;lt;num;c++)&lt;br&gt;&#xD;
               &#xD;
{&lt;br&gt;&#xD;
                   &#xD;
var val = elems[c].getAttribute('googliebah'); &#xD;
&lt;br&gt;&#xD;
                   &#xD;
if(val!=null &amp;amp;&amp;amp; val==name)&lt;br&gt;&#xD;
                       &#xD;
return elems[c]; &#xD;
&lt;br&gt;&#xD;
               &#xD;
}&lt;br&gt;&#xD;
            }&lt;br&gt;&#xD;
        &amp;lt;/script&amp;gt;&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
And you use it to find some control like this: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&amp;lt;div googliebah='test' id='test' class="title"&amp;gt;&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
By doing something like this: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&amp;lt;input id="Button2" onclick="var elem = newFind('test'); if(elem)alert(elem.id);"&#xD;
....&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=70870288-191a-4dd0-a1a0-61365a26dea1"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BoUiybCQJG0:unZ4tdn8oDE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BoUiybCQJG0:unZ4tdn8oDE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=BoUiybCQJG0:unZ4tdn8oDE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BoUiybCQJG0:unZ4tdn8oDE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BoUiybCQJG0:unZ4tdn8oDE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=BoUiybCQJG0:unZ4tdn8oDE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/BoUiybCQJG0" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,70870288-191a-4dd0-a1a0-61365a26dea1.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
      <category>JavaScript</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,70870288-191a-4dd0-a1a0-61365a26dea1.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=af22bf41-8eea-4769-a49b-2cb9b5cdf664</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,af22bf41-8eea-4769-a49b-2cb9b5cdf664.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,af22bf41-8eea-4769-a49b-2cb9b5cdf664.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=af22bf41-8eea-4769-a49b-2cb9b5cdf664</wfw:commentRss>
      <title>Under the hood with ASP.NET AJAX Animations - Part 4 (How ASP.NET AJAX Animations work)</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,af22bf41-8eea-4769-a49b-2cb9b5cdf664.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/AY4P2TT6d5k/PermaLink,guid,af22bf41-8eea-4769-a49b-2cb9b5cdf664.aspx</link>
      <pubDate>Sat, 11 Aug 2007 21:55:07 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;?xml:namespace prefix = o /&gt;In
this post, I'm going to end my discussion on Animations in ASP.NET AJAX by showing
you how they work, internally. At the end of this post you should not only know how
Animations work, but also how ExtenderControl's work in general. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;span style="COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;font size=3&gt;What
is an ExtenderControl?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;An
Animation is actually just an ExtenderControl, so it will do us some good to understand
what an ExtenderControl is all about. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;ExtenderControls
are script controls that apply a particular feature from ASP.NET AJAX to an already
existing ASP.NET (non-AJAX) control. For example, if you wanted to apply some cool,
new feature of ASP.NET AJAX to a standard radio button control, you'd do so through
the implementation of an ExtenderControl. Extender control's work by emitting JavaScript
that is attached to and extends functionality of an ASP.NET control. You will always
need to reference the control to which you are applying the extender because it will
need to know which control the emitted script should target. The key thing to remember
is that it's an ExtenderControl is an auxiliary to an existing control, and typically
the extending features are done through JavaScript. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;Exactly
how does the script emitted by an ExtenderControl become attached to the target ASP.NET
control? Script becomes successfully attached to pre-existing controls through the
runtime execution of the ScriptManager on the server, the use of a type known as the
ScriptDescriptor, and the bootstrap client-side code of ASP.NET AJAX on the client. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;On
the server, the process looks something like this&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;/span&gt;&amp;nbsp;&lt;img src="http://www.ben-rush.net/blog/content/binary/112345.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;The
process starts when the ASP.NET runtime asks the ScriptManager (a native, server-side
control) to render itself out. The result of doing so causes the ScriptManager to
ask every control that has attached itself to the ScriptManager to render itself out
too (an Animation, being an ExtenderControl, is therefore asked to render). 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;A
script control is a special, new type of control introduced into the ASP.NET AJAX
framework as a control that relies heavily on the scripting facilities of ASP.NET
AJAX. One of the important features of a script control that sets it apart from other
controls is that it has a great deal of functionality that must be executed on the
client (through JavaScript) for it to function properly. A script control is responsible
for giving all scripts and script types it requires to operate to the ScriptManager
when it renders; doing so guarantees that the script will be included in the page
output and therefore included in the rendered page. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;Script
controls hand off all the necessary script and script types to the ScriptManager as
nicely packaged objects known as ScriptDescriptors and ScriptReferences. &lt;span&gt;&amp;nbsp;&lt;/span&gt;We’re
more interested in ScriptDescriptors, however, as they are the layout for the JavaScript
types and so (if you refer to the diagram above) you see that our extender control
(when asked to render) calls back into the ScriptManager to register all its types.
Doing so finally calls into ScriptDescriptor.GetScript() which returns back a block
of script leveraging the $create() shortcut method and a series of JSON-formatted
data.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;When
the ScriptManager renders, then, it guarantees that the JSON-formatted data of the
control will be instantiated and initialized on the client through the $create() method.
How? Because the ScriptManager will wrap the output of GetScript around the Sys.Application.add_init()
javascript method. Add_init() actually attaches code to the initialization script
of ASP.NET AJAX’s client libraries; this guarantees that, when ASP.NET AJAX is fully
started up on the client when the page has fully loaded, your initialization routine
will be called. What the initialization routine does, however, is up to you.&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=3&gt;&lt;strong&gt;&lt;span style="COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;How
Does an Animation Work?&lt;/span&gt;&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;You're
90% of the way to understanding Animations now. All that's really required is a bit
of a filler-explanation for what, specifically, the Animation extender control is
doing. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;On
the server the Animation control will take your XML markup and create an in-memory
Animation object instance representing all of the properties and child/parent associations.
Since an Animation is an extender control, the ScriptManager will ask it to render.
The result of the Render call will be the JSON-formatted version of the Animation
object from the server (property values, event-handling code&amp;nbsp;and all). Just like
above, the JSON-formatted initialization code will be wrapped around a Sys.Application.add_init()
script method so that it will be executed when the page is loaded on the client. This
is an example of what the output looks like:&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;/span&gt;&lt;img src="http://www.ben-rush.net/blog/content/binary/2123.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;…this
is actually the result of a view source on one of the animation examples on &lt;a href="http://www.asp.net/"&gt;&lt;font color=#0000ff&gt;www.asp.net&lt;/font&gt;&lt;/a&gt;.
There is a lot of code here, but if you squint carefully you can see it all starts
with a Sys.Application.add_init() call. Also if you look carefully you’ll see that
it’s actually instantiating, on the client, an object of type AjaxControlToolkit.Animation.AnimationBehavior.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;strong&gt;&lt;font size=3&gt;The
AnimationBehavior Object&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;If
you recall from earlier discussions about Animations, there are actually many instances
where multiple animation effects (a fade out, or a color change) can occur in sequence
as the result of a single event (onclick). Each animation effect is actually an Animation
object, and the object that surrounds each Animation (to make them happen in sequence)
is also an Animation object – so we have Animation objects housing multiple Animation
objects. This can be confusing when rendered out to the client, so the ASP.NET AJAX
client framework wraps all the animations that need to be rendered to the client for
a single Animation extender as an AnimationBehavior object. The AnimationBehavior
object is what gets instantiated on the client and has its initialize() method called. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;The
initialize() method of the AnimaitonBehavior object will inspect which events need
to be registered (OnClick, etc) and attach event handlers to the target control on
the page (the client-side control which we’re extending). Whenever that event occurs
on the client, the event handler for the AnimationBehavior will be called and it will
route that event to the proper Animation object. Here is an example of the AnimationBehavior’s
OnClick event hander: &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;img src="http://www.ben-rush.net/blog/content/binary/412.jpg" border=0&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;…which,
after a bit more traversing the internals of the script library, plays the Animation.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;strong&gt;&lt;font size=3&gt;How
does the Animation object actually play the animation?&lt;/font&gt;&lt;/strong&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;It
may seem like somewhat of a mystery when you declare XML on your page that then translates
into some dynamically updating DHTML object, but if you think carefully about what
it take to animate a DHTML object the mystery subsides. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;All
that it takes to animate something on your page is a timer ticking at a regular inte&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;rval
whose callback method updates some DHTML object property (x- and y-position, for example).
And that’s all an Animation object is on the client – just a fancy timer that updates
properties with values you specify; invoking the play method above simply starts off
the timer, and thus the DHTML effects. Therefore all that’s needed within the JSON
data is enough information to identify what property you’re updating on what object,
at what interval, and with what values – the existing script of the Animation object
will take care of the rest. If you look at some of the JSON-serialized data that is
being rehydrated on the client, you actually can see just that information (take a
closer look):&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.ben-rush.net/blog/content/binary/3123.jpg" border=0&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;..and
that’s how Animations work. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: rgb(0,51,0); FONT-FAMILY: 'Verdana','sans-serif'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=af22bf41-8eea-4769-a49b-2cb9b5cdf664" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=AY4P2TT6d5k:ggG8RbbfEIw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=AY4P2TT6d5k:ggG8RbbfEIw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=AY4P2TT6d5k:ggG8RbbfEIw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=AY4P2TT6d5k:ggG8RbbfEIw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=AY4P2TT6d5k:ggG8RbbfEIw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=AY4P2TT6d5k:ggG8RbbfEIw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/AY4P2TT6d5k" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,af22bf41-8eea-4769-a49b-2cb9b5cdf664.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
      <category>Under the Hood</category>
      <category>Web 2.0</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,af22bf41-8eea-4769-a49b-2cb9b5cdf664.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=e0177f26-98c8-4992-97eb-70875aed2440</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,e0177f26-98c8-4992-97eb-70875aed2440.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,e0177f26-98c8-4992-97eb-70875aed2440.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e0177f26-98c8-4992-97eb-70875aed2440</wfw:commentRss>
      
      <title>How to determine if CollapsiblePanel is expanded or collapsed? </title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,e0177f26-98c8-4992-97eb-70875aed2440.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/WPxJ1jNOqEM/PermaLink,guid,e0177f26-98c8-4992-97eb-70875aed2440.aspx</link>
      <pubDate>Thu, 09 Aug 2007 20:46:48 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
The &lt;a href="http://asp.net/AJAX/Control-Toolkit/Live/CollapsiblePanel/CollapsiblePanel.aspx"&gt;CollapsiblePanel&lt;/a&gt; is&#xD;
an ASP.NET AJAX extender control in the AJAX Control Toolkit. This particular extender&#xD;
control extends the default behavior of the standard ASP.NET Panel to collapse and&#xD;
expand when a particular element on the page is clicked (it will scroll open or closed&#xD;
when this trigger element is clicked). It's very easy and elegant to use, but one&#xD;
common question seems to be - when a full post back is triggered - what is the current&#xD;
(or most recent) state of the panel - collapsed or expanded? &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The way to find out is by inspecting the ClientState property on the CollapsiblePanel's&#xD;
instance: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/11234.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
If ClientState is true, then the panel is collapsed; if the ClientState is false,&#xD;
then the panel is expanded. &#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=e0177f26-98c8-4992-97eb-70875aed2440"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WPxJ1jNOqEM:N8EBEWvt9rU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WPxJ1jNOqEM:N8EBEWvt9rU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=WPxJ1jNOqEM:N8EBEWvt9rU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WPxJ1jNOqEM:N8EBEWvt9rU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=WPxJ1jNOqEM:N8EBEWvt9rU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=WPxJ1jNOqEM:N8EBEWvt9rU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/WPxJ1jNOqEM" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,e0177f26-98c8-4992-97eb-70875aed2440.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
      <category>JavaScript</category>
      <category>Web 2.0</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,e0177f26-98c8-4992-97eb-70875aed2440.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=51628ddb-a115-4190-9ff2-0400e4db27b0</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,51628ddb-a115-4190-9ff2-0400e4db27b0.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,51628ddb-a115-4190-9ff2-0400e4db27b0.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=51628ddb-a115-4190-9ff2-0400e4db27b0</wfw:commentRss>
      
      <title>Under the hood with ASP.NET AJAX Animations - Part 3</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,51628ddb-a115-4190-9ff2-0400e4db27b0.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/BEtPmGKg9As/PermaLink,guid,51628ddb-a115-4190-9ff2-0400e4db27b0.aspx</link>
      <pubDate>Thu, 09 Aug 2007 01:46:50 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
In my &lt;a href="http://www.ben-rush.net/blog/PermaLink,guid,8638113b-bc56-4660-b096-ca666e78081c.aspx"&gt;first&#xD;
post&lt;/a&gt; in this series on using ASP.NET AJAX animations I described the basics of&#xD;
what an Animation was and the foundations behind using it. In my &lt;a href="http://www.ben-rush.net/blog/PermaLink,guid,d84e452b-2bb6-4809-9d2c-569797b8c9e2.aspx"&gt;second&#xD;
post&lt;/a&gt;, I then started showing you how to go about using it (the basics). What remains&#xD;
are a few exceptional Animations that will be used in unusual circumstances (hence&#xD;
them being "exceptional") but which enable you with a great deal of power when you &lt;em&gt;do&lt;/em&gt; decide&#xD;
to use them.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font size="3"&gt;&#xD;
            &lt;strong&gt;The Condition Animation&lt;/strong&gt;&#xD;
          &lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Why stop a good thing? So I'm going to continue using the (somewhat lame) example&#xD;
from my previous posts where I take a simple ASP.NET button control and do things&#xD;
to it using the Animation framework. In this example I leverage an animation called&#xD;
the Condition Animation; it gives you the ability to programmatically choose one of&#xD;
two (at most) animations to run depending on the boolean result of some script. For&#xD;
example, take the following Animation XML: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/1123.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
By clicking button &lt;em&gt;Button1&lt;/em&gt;, the &lt;em&gt;Condition&lt;/em&gt;&lt;em&gt;Animation&lt;/em&gt; will&#xD;
be executed (if this block doesn't make sense, see my &lt;a href="http://www.ben-rush.net/blog/PermaLink,guid,8638113b-bc56-4660-b096-ca666e78081c.aspx"&gt;first&#xD;
post&lt;/a&gt; and read forward). Take note of the Condition Animation and it's child Animations.&#xD;
The first thing to take note of is the ConditionScript attribute on the Condition&#xD;
element; it's a simple statement: "false;". Although this is just a boolean result&#xD;
(false), it could be an entire JavaScript statement which evaluates to either true&#xD;
or false. For Condition Animations, if the resultant script statement evaluates to &lt;em&gt;true&lt;/em&gt;,&#xD;
then the first child Animation is executed (in this sample, the FadeOut animation);&#xD;
if the script statement evalutes to &lt;em&gt;false&lt;/em&gt;, then the second child Animation&#xD;
(which is the Color animation) would be executed. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Given that you now have programmatic control over what Animation is executed, you&#xD;
can take conditions on the page, evaluate them through the script, and then decide&#xD;
which Animation to run. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font size="3"&gt;&#xD;
            &lt;strong&gt;The Case Animation&lt;/strong&gt;&#xD;
          &lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Being limited to one of two Animations is, well limiting. In the event that you need&#xD;
to pick from a wider spectrum of Animations, but still do so using the result of a&#xD;
script statement, then you would leverage the Case Animation. Take the following XML&#xD;
Animation block: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/212.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The result of the &lt;em&gt;SelectScript&lt;/em&gt; must be a 0-based index into the array of&#xD;
child Animations (0 is the first Animation or the "FadeOut" animation, 1 is the second&#xD;
animation or the "Color" animation in our example, and so forth). In my example I&#xD;
simply return "1" but, like the Condition Animation above, you could have an&#xD;
entire script statement as the SelectScript value. So long as your script statement&#xD;
evaluates to a valid index into the array of child Animations beneath your Case animation&#xD;
it will behave properly. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
In the above example, the Color animation will be executed. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;The Script Animation&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
To flat out execute script in the Animation you would leverage the Script Animation.&#xD;
Take the following example: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/312.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
What we have here is a Sequence Animation housing a FadeOut and then a ScriptAction&#xD;
animation. Given what we already know about a Sequence animation, the child nodes&#xD;
(or child Animations) will be executed sequentially from top to bottom. Therefore,&#xD;
when Button1 is clicked, the Button will fade out over half a second and then a script&#xD;
modal window will pop up saying "All done". Of course, much more advanced script could&#xD;
be executed from the ScriptAction, but you get the basic idea. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;What's Next?&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Okay, next we are going to dive into the pipeline to see just how this magic is done.&#xD;
Stick around...&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=51628ddb-a115-4190-9ff2-0400e4db27b0"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BEtPmGKg9As:M_u_a_8bnGY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BEtPmGKg9As:M_u_a_8bnGY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=BEtPmGKg9As:M_u_a_8bnGY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BEtPmGKg9As:M_u_a_8bnGY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=BEtPmGKg9As:M_u_a_8bnGY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=BEtPmGKg9As:M_u_a_8bnGY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/BEtPmGKg9As" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,51628ddb-a115-4190-9ff2-0400e4db27b0.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
      <category>JavaScript</category>
      <category>Under the Hood</category>
      <category>Web 2.0</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,51628ddb-a115-4190-9ff2-0400e4db27b0.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=3aca8c34-7e9f-4fd3-bce6-183c47894298</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,3aca8c34-7e9f-4fd3-bce6-183c47894298.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,3aca8c34-7e9f-4fd3-bce6-183c47894298.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=3aca8c34-7e9f-4fd3-bce6-183c47894298</wfw:commentRss>
      <slash:comments>4</slash:comments>
      
      <title>I'm published</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,3aca8c34-7e9f-4fd3-bce6-183c47894298.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/yaXAz6gD8bk/PermaLink,guid,3aca8c34-7e9f-4fd3-bce6-183c47894298.aspx</link>
      <pubDate>Mon, 06 Aug 2007 15:02:36 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
If you get MSDN, you can read my new article "ASP.NET ScriptManager Enables AJAX in&#xD;
your web apps". It received top billing in the September issue of MSDN. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
If you have feedback, please post it here - I have another article planned soon. &#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=3aca8c34-7e9f-4fd3-bce6-183c47894298"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=yaXAz6gD8bk:QLjk2euKVYA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=yaXAz6gD8bk:QLjk2euKVYA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=yaXAz6gD8bk:QLjk2euKVYA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=yaXAz6gD8bk:QLjk2euKVYA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=yaXAz6gD8bk:QLjk2euKVYA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=yaXAz6gD8bk:QLjk2euKVYA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/yaXAz6gD8bk" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,3aca8c34-7e9f-4fd3-bce6-183c47894298.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,3aca8c34-7e9f-4fd3-bce6-183c47894298.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=50c37b40-6377-40a8-8449-eeb246b2d4c6</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,50c37b40-6377-40a8-8449-eeb246b2d4c6.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,50c37b40-6377-40a8-8449-eeb246b2d4c6.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=50c37b40-6377-40a8-8449-eeb246b2d4c6</wfw:commentRss>
      
      <title>I'm starting another blog</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,50c37b40-6377-40a8-8449-eeb246b2d4c6.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/IElwdAqoS_0/PermaLink,guid,50c37b40-6377-40a8-8449-eeb246b2d4c6.aspx</link>
      <pubDate>Sat, 04 Aug 2007 17:12:44 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I'm starting another blog on the business/psychology/technology of the new social&#xD;
web over &lt;a href="http://www.ben-rush.net/ebiz/default.aspx"&gt;here&lt;/a&gt;. The purpose&#xD;
of it is to be less nuts and bolts and more study of the interplay between the business,&#xD;
technology and psychology of the Web 2.0 world. I'm going to analyize, break-down&#xD;
and study as much as I can about that world and hopefully open up some interesting&#xD;
dialog as the blog continues to grow. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
...I have become more and more interested in that business/psychology/technology aspect&#xD;
of web world lately and have been wanting to study it more (and thus write about it).&#xD;
However, I didn't want to muddy up the point of this blog as a place for people to&#xD;
go to understand the under-the-hood pieces of Microsoft .NET technologies, so I just&#xD;
created a second one. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I invite you to come on over when you have a chance, I'll be posting regularly and&#xD;
- hopefully - have some interesting things to say. &#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=50c37b40-6377-40a8-8449-eeb246b2d4c6"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=IElwdAqoS_0:OzD1ilYqNWs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=IElwdAqoS_0:OzD1ilYqNWs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=IElwdAqoS_0:OzD1ilYqNWs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=IElwdAqoS_0:OzD1ilYqNWs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=IElwdAqoS_0:OzD1ilYqNWs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=IElwdAqoS_0:OzD1ilYqNWs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/IElwdAqoS_0" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,50c37b40-6377-40a8-8449-eeb246b2d4c6.aspx</comments>
      <category>Ranting</category>
      <category>Web 2.0</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,50c37b40-6377-40a8-8449-eeb246b2d4c6.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.ben-rush.net/blog/Trackback.aspx?guid=d84e452b-2bb6-4809-9d2c-569797b8c9e2</trackback:ping>
      <pingback:server>http://www.ben-rush.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.ben-rush.net/blog/PermaLink,guid,d84e452b-2bb6-4809-9d2c-569797b8c9e2.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.ben-rush.net/blog/CommentView,guid,d84e452b-2bb6-4809-9d2c-569797b8c9e2.aspx</wfw:comment>
      <wfw:commentRss>http://www.ben-rush.net/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d84e452b-2bb6-4809-9d2c-569797b8c9e2</wfw:commentRss>
      
      <title>Under the hood with ASP.NET AJAX Animations - Part 2</title>
      <guid isPermaLink="false">http://www.ben-rush.net/blog/PermaLink,guid,d84e452b-2bb6-4809-9d2c-569797b8c9e2.aspx</guid>
      <link>http://feedproxy.google.com/~r/benrush/~3/Qo5ikDB2FSA/PermaLink,guid,d84e452b-2bb6-4809-9d2c-569797b8c9e2.aspx</link>
      <pubDate>Fri, 03 Aug 2007 21:34:22 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
In my &lt;a href="http://www.ben-rush.net/blog/PermaLink,guid,8638113b-bc56-4660-b096-ca666e78081c.aspx"&gt;previous&#xD;
post&lt;/a&gt; I gave a brief overview of what an Animation is in ASP.NET AJAX, and now&#xD;
it's time to understand how you go about actually using them. By the end of this post&#xD;
you should be able to look at a block of Animation XML and understand what it's doing&#xD;
and you should be able to write a block of Animation XML without needing to lookback&#xD;
on a sample block of code (too much). &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;Let's Recap for a Moment&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Before diving, let's recap from my previous post: an Animation in the ASP.NET AJAX&#xD;
framework is any DHTML effect that leverages the Animation framework provided by the&#xD;
ASP.NET AJAX toolkit (which can be found &lt;a href="http://asp.net/ajax/control-toolkit/live/"&gt;here&lt;/a&gt;).&#xD;
The problem found in playing with DHTML in the past has been that you've needed JavaScript&#xD;
(and sometimes pretty hairy JavaScript) to do anything meaningful with it. As programmers&#xD;
we're "resourceful" (or lazy) and therefore don't want to do more work than we need.&#xD;
With the Animation framework in ASP.NET AJAX, you only need to worry about XML markup&#xD;
specific to the animation you want. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
In short, ASP.NET AJAX Animations are the easy way of adding cool DHTML animations&#xD;
and effects to your page - it achieves this by letting you define and play with your&#xD;
animations declaratively through an XML syntax.  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;Show Me an Example&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Let's go back to an earlier example that I did (because of its utter simplicity) and&#xD;
work out from there. In my &lt;a href="http://www.ben-rush.net/blog/PermaLink,guid,8638113b-bc56-4660-b096-ca666e78081c.aspx"&gt;previous&#xD;
post&lt;/a&gt; I showed an example effect on a button where, once you clicked the button,&#xD;
it's text color changed red and then faded out: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/button3.JPG"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
to....&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/button4.JPG"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
You achived this effect by using declarative XML syntax. The syntax let you play with&#xD;
the properties (the starting color and ending color in this example) without needing&#xD;
to write any code; thereby making things easier and more manageable for everyone.&#xD;
Let's break the syntax I showed you earlier down one element at a time so that you&#xD;
can see why a particular element exists and what it does. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font size="3"&gt;Understanding the ASP.NET Animation XML Syntax&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
As I said earlier, to write an Animation in ASP.NET AJAX, you use an XML syntax. The&#xD;
syntax that resulted in the above button color change looks like this: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/animation1.JPG" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;u&gt;First&lt;/u&gt; thing to take away is that this is a &lt;em&gt;control extender&lt;/em&gt; - or an&#xD;
object in the ASP.NET AJAX framework that let's you apply AJAX'ish properties to an&#xD;
already existing, standard ASP.NET control (you can learn more about extenders &lt;a href="http://asp.net/AJAX/Documentation/Live/tutorials/ExtenderControlTutorial1.aspx"&gt;here&lt;/a&gt;).&#xD;
What this means, practically, is that the animation needs to know to what standard&#xD;
ASP.NET control the animation will be applied. If you take a look at the first line&#xD;
of XML, you'll see the &lt;strong&gt;TargetControlID&lt;/strong&gt; property pointing to &lt;strong&gt;Button1&lt;/strong&gt;.&#xD;
You should know that this Animation will, then, be applied to &lt;strong&gt;Button1&lt;/strong&gt;. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/112.JPG" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;u&gt;Second&lt;/u&gt; is the Animations element which will house all of the animations you&#xD;
will apply to Button1 (that's right, you can apply more than one, even in parallel).&#xD;
This may seem somewhat redundant, but it is required. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;u&gt;Third&lt;/u&gt; we have an event name. In our example, OnClick, means that the Animations&#xD;
will be executed during the OnClick event of Button1 (bear in mind that this is the &lt;em&gt;client&lt;/em&gt; onclick&#xD;
event, not the &lt;em&gt;server&lt;/em&gt; one). Therefore when someone clicks Button1, the animations&#xD;
specified below the OnClick event node will be executed. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/21.JPG" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The events &lt;em&gt;OnClick&lt;/em&gt;, &lt;em&gt;OnLoad&lt;/em&gt;, &lt;em&gt;OnMouseOver&lt;/em&gt;, &lt;em&gt;OnMouseOut&lt;/em&gt;, &lt;em&gt;OnHoverOver&lt;/em&gt; and &lt;em&gt;OnHoverOut&lt;/em&gt; are&#xD;
valid events; meaning you don't have to just use OnClick, you could also use OnHover.&#xD;
It's interesting to note that you can have all of these event handlers under the same&#xD;
Animations element if you wanted to - therefore, you could have one Animation registered&#xD;
for OnClick, and a totally different one registered for OnMouseOver, thereby creating&#xD;
a very dynamic control!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;u&gt;Fourth&lt;/u&gt; we have a sequence element; but - I have to admit to something here,&#xD;
this is actually not necessary in our example. I added it because I wanted to make&#xD;
a point about something. The point I want to make is a subtle one: you can only have&#xD;
one Animation registered for a particular event type (OnClick, OnMouseOver). The reason&#xD;
this isn't a limitation, however, is because there are two Animations called&#xD;
Sequence and Parallel which are not only valid Animations themselves, but allow nesting&#xD;
of other animations. Therefore, Sequence is an Animation itself that will call each&#xD;
child Animation one after another (in "Sequence"), and Parallel is an Animation that&#xD;
will call each child Animation at the same time (in "Parallel"). This is a subtle,&#xD;
yet powerful, thing to realize. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So..the following XML is actually valid (note the missing Sequence element): &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/31.JPG" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
But, if you wanted to change the color of the button and THEN fade it away completely,&#xD;
for example, you would have to nest the Color Animation and FadeOut animation within&#xD;
a Sequence Animation (not doing so will result in a runtime exception). The XML must&#xD;
look like this: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/41.JPG" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The result from the above XML declaration is to fade the button's color from FF0000&#xD;
to 666666 and then completely fade it out of existence in .5 seconds. What's really&#xD;
cool is if you wanted to do both at the same time, all you have to do is change the&#xD;
Sequence element to a Parallel element: &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.ben-rush.net/blog/content/binary/51.JPG" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Cool, huh? Now the color change and the fade-to-nothing will happen at the same time&#xD;
or in &lt;em&gt;Parallel&lt;/em&gt;. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The lowest level element of the structure is always the actual Animation itself (&lt;strong&gt;Color&lt;/strong&gt; for&#xD;
color change, &lt;strong&gt;FadeOut&lt;/strong&gt; for fading out the element, etc). &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font size="3"&gt;&#xD;
            &lt;strong&gt;Does it Get Tougher?&lt;/strong&gt;&#xD;
          &lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Yes, somewhat because you can actually tie into the XML script to be executed when&#xD;
certain events occur and conditional statements. We'll explore that, however, next&#xD;
time...&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.ben-rush.net/blog/aggbug.ashx?id=d84e452b-2bb6-4809-9d2c-569797b8c9e2"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/benrush?a=Qo5ikDB2FSA:nKvPtOSNqok:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=Qo5ikDB2FSA:nKvPtOSNqok:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=Qo5ikDB2FSA:nKvPtOSNqok:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=Qo5ikDB2FSA:nKvPtOSNqok:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/benrush?a=Qo5ikDB2FSA:nKvPtOSNqok:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/benrush?i=Qo5ikDB2FSA:nKvPtOSNqok:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/benrush/~4/Qo5ikDB2FSA" height="1" width="1"/&gt;</description>
      <comments>http://www.ben-rush.net/blog/CommentView,guid,d84e452b-2bb6-4809-9d2c-569797b8c9e2.aspx</comments>
      <category>AJAX</category>
      <category>ASP.Net</category>
      <category>JavaScript</category>
      <category>Under the Hood</category>
      <category>Web 2.0</category>
    <feedburner:origLink>http://www.ben-rush.net/blog/PermaLink,guid,d84e452b-2bb6-4809-9d2c-569797b8c9e2.aspx</feedburner:origLink></item>
  </channel>
</rss>
