JavaScript
  Home arrow JavaScript arrow Page 3 - 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  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
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: 5 stars5 stars5 stars5 stars5 stars / 23
    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) - Creating an animated web page step-by-step


    (Page 3 of 5 )

    The ASP.NET 2.0 AJAX extensions can be downloaded from the Microsoft site. If you installed ATLAS make sure you remove it before running the executable to install the ASP.NET 2.0 AJAX extensions. The message when you try to install the extensions will only say remove the earlier version; it does not say ATLAS explicitly. In VS Studio 2005, open the AjaxControlToolKit.sln file; there you can create your web page. When you add a web page make sure the page and Register Assembly declaration are as shown in the tutorial examples.

    OnMouseOver and OnMouseOut events of controls

    These are well known events that need no explanation. Create a web page and add ScriptManager either by double clicking it in the AJAX Extensions group in the Toolbox, or dragging and dropping it on the design pane of the web page, here called MouseInOut.aspx. When you add the ScriptManager to the design, a declarative tag, <asp:ScriptManager id="ScriptManager1"/>, will be added to the <form/>.

    Next, double click an AnimationExtender under the AjaxControlToolkit Components group in the Toolbox. This adds the two controls to the design pane as shown.

    At this point your Source pane should be displaying the following code.

    <%@ Page Language="C#" AutoEventWireup="true"
    CodeFile="MouseInOut.aspx.cs"
    Inherits="Animation_MouseInOut" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
      <title>Untitled Page</title>
    </head>
    <body>
      <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <cc1:AnimationExtender ID="AnimationExtender1"
    runat="server">
        </cc1:AnimationExtender>

      </form>
    </body>
    </html>

    For both the Register Assembly and the AnimationExtender replace "ccl" with "ajaxToolkit." This is necessary because we are referencing this assembly for this site. Once you do this, the other components you will add will have the correct reference.

    Next drag and drop a Panel control from the Standard Group in the toolbox after the closing tag of the AnimationExtender as shown. At this point your source code should appear as follows:

    <%@ Page Language="C#" AutoEventWireup="true"
    CodeFile="MouseInOut.aspx.cs"
    Inherits="Animation_MouseInOut" %>

    <%@ Register Assembly="AjaxControlToolkit"
    Namespace="AjaxControlToolkit"
    TagPrefix="ajaxToolkit" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
      <title>Untitled Page</title>
    </head>
    <body>
      <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <ajaxToolkit:AnimationExtender ID="AnimationExtender1"
    runat="server">

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

    The design view should show the following in the design pane. Note that the Panel has an Id property set to Panel1. The target of the animation will be this control, known by its Id property.

    Now inside the AnimationExtender tag, if you place your cursor and move away you see a drop-down as shown.

    Here you need to pick up the TargetControlID and set its value equal to Panel1 as shown. Whatever action is related to the control whose Id is set equal to "Panel1" will be animated. All attributes and values in the declarations should be under double quotes. While the intellisense provides the item list, you need to add the quotes. This is something the developers of ACT should have taken care of in the design.

    For the sake of brevity, only the tag contents inside the <form/> tags are shown as there is no change to the rest of the code. A few other properties are also added to the panel as shown.

    <form id="form1" runat="server">

    <!--ScriptManager must be placed before others-->
      <asp:ScriptManager ID="ScriptManager1" runat="server">
      </asp:ScriptManager>
      <ajaxToolkit:AnimationExtender ID="AnimationExtender1"
      runat="server" TargetControlID="Panel1" >
      <!-- Animation related items go in here-->
      </ajaxToolkit:AnimationExtender>

    <!-- any of the appropriate server controls-->
      <asp:Panel ID="Panel1" runat="server"
        Height="50px" Width="125px"
        BackColor="AliceBlue" BorderStyle="Groove">
        "My first animation with ACT"
      </asp:Panel>
    </form>

    More JavaScript Articles
    More By Jayaram Krishnaswamy


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

    JAVASCRIPT ARTICLES

    - 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
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables
    - Assigning Background Colors Dynamically to Z...
    - Building Zebra Tables with CSS and JavaScript
    - JavaScript: Array Objects
    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway