O'Reilly logo

Professional ASP.NET 3.5 AJAX by Matt Gibbs, Dan Wahlin, Bill Evjen, Dave Reed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required