JavaScript
  Home arrow JavaScript arrow Page 5 - Using the AnimationExtender Component in A...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Using the AnimationExtender Component in Ajax Control Toolkit (ACT)
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 32
    2007-03-13

    Table of Contents:
  • Using the AnimationExtender Component in Ajax Control Toolkit (ACT)
  • The AJAX Extensions and the ACT Components
  • Creating an animated web page step-by-step
  • Adding the animation tags
  • OnClick event of a control

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using the AnimationExtender Component in Ajax Control Toolkit (ACT) - OnClick event of a control


    (Page 5 of 5 )

    Make the changes to the Animations tag as shown. You need to change only the XML children of the Animations tag. Now build the solution and test. In this case you need to click on Panel1, which has the default black color for the text, which changes from red to blue in two seconds. The code in the <form/> should appear as shown.

    <form id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server">
      </asp:ScriptManager>
      <ajaxToolkit:AnimationExtender ID="AnimationExtender1"
    runat="server" TargetControlID="Panel1" >
      <Animations>
        <OnClick>
          <Color Duration="2" StartValue="#FF3300"
            EndValue="#0033FF" Property="style"
            PropertyKey="color" />
        </OnClick>
      </Animations>
      </ajaxToolkit:AnimationExtender>
      <asp:Panel ID="Panel1" runat="server"
        Height="50px" Width="125px"
        BackColor="AliceBlue" BorderStyle="Groove">
        "My first animation with ACT"
      </asp:Panel>
    </form>

    OnLoad with OnClick event

    The OnLoad event kicks in when the page loads, and you can see the fore color of the text changes its color. There is an additional Animation I also added which uses the click event. After the first animation, if you click on the Panel, you should see the panel content "FadeIn." The source code in the <form/> for this is as shown.

    <form id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server">
      </asp:ScriptManager>
      <ajaxToolkit:AnimationExtender ID="AnimationExtender1"
      runat="server" TargetControlID="Panel1" >
      <Animations>
        <OnLoad>
          <Color Duration="10" StartValue="#FF3300"
            EndValue="#0033FF" Property="style"
            PropertyKey="color" />
        </OnLoad>
      </Animations>
      <Animations>

        <OnClick>
          <FadeIn Duration="10" Fps="20" />
        </OnClick> 
      </Animations>
      </ajaxToolkit:AnimationExtender>
      <asp:Panel ID="Panel1" runat="server"
        Height="50px" Width="125px"
        BackColor="AliceBlue" BorderStyle="Groove">
        "My first animation with ACT"
      </asp:Panel>
    </form>

    Sequenced Events

    You can sequence the events by using the <Sequence/> tag as shown.

    <form id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server">
      </asp:ScriptManager>
      <ajaxToolkit:AnimationExtender ID="AnimationExtender1" 
      runat="server" TargetControlID="Panel1" > 

      <Animations>
        <OnClick>
          <Sequence>
            <FadeIn Animation Target="Animated Control"
              Duration="1"/>
            <Move Horizontal="-150" Vertical="50" />
            <Color StartValue="#AA0000"
              EndValue="#FFAAAA"
              Property="style"
              PropertyKey="backgroundColor" />
            <Resize Width="200" Height="150" />
          </Sequence>
        </OnClick> 
      </Animations>

      </ajaxToolkit:AnimationExtender>
      <asp:Panel ID="Panel1" runat="server"
        Height="50px" Width="125px"
        BackColor="AliceBlue" BorderStyle="Groove">
        "My first animation with ACT"
      </asp:Panel>
    </form>

    When the page is displayed you will see the following on the browser.

    When you click on the panel you will see a sequence of events taking place. It fades for a while and moves out and resizes itself before its color change. The final display is as shown.

    Summary

    This basic tutorial on Ajax Control Toolkit's animation component dealt with the declarative tags used in the animation. This is only scratching the surface of this control; it is possible to get a variety of effects by combining them using the effects by themselves, or combining them in various ways. Readers may encounter some troubling features; for example, while the design may throw some exceptions, the build succeeds and controls would work. Please make trips to Microsoft Ajax site to resolve some of the problems.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Declarative mark up will have a larger following as it appeals to developers who are...
     

    JAVASCRIPT ARTICLES

    - Using Click Interceptions with a Database-Dr...
    - Using JavaScript Click Interceptions in an I...
    - Using Click Interceptions with JavaScript
    - QuickSort in Action
    - Quicksort
    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT