10.2. Examples of Animation Actions

Now that you have a general understanding of the framework and the tools at your disposal, this section looks at some of the actions that you can use and provides some samples of using these actions.

10.2.1. Using the <FadeOut> Action in a Sequence

To show an example of using the <FadeOut> element along with a sequence of animations, Listing 10-2 expands upon the earlier example by adding another animation to the list of sequenced animations.

Example 10-2. Fading out text using FadeOut animation
<script runat="server"> <%@ Page Language="C#" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> protected void Button1_Click(object sender, EventArgs e) { Label1.Text = "Hello " + TextBox1.Text; } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Growing Label</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> &nbsp;<asp:Button ID="Button1" runat="server" Text="Submit your name" OnClick="Button1_Click" /> <br /><br /> <asp:Label ID="Label1" runat="server"></asp:Label> <cc1:AnimationExtender ID="Label1_AnimationExtender" runat="server" Enabled="True" TargetControlID="Label1"> <Animations> <OnLoad> <Sequence> <Scale ScaleFactor="4" Unit="px" ScaleFont="true" FontUnit="pt" Duration="2.5" Fps="50" ></Scale> <FadeOut Duration="5" Fps="25" /> </Sequence> ...

Get Professional ASP.NET 3.5 AJAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.