AjaxControltoolkit学习笔记—Animation使用详解 (asp.net C#)

来源:互联网 发布:php发送大量邮件 编辑:程序博客网 时间:2024/04/30 07:51

功能:28个控件种效果最酷的!顾名思义实现动画效果
细节: (1)不只是控件:pluggable, extensible framework
(2)用在什么时候:OnLoad OnClick OnMouseOver OnMouseOut OnHoverOver OnHoverOut
(3)具体使用有很多可以谈的,有理由单独写一个Animation Xml 编程介绍

Animation 不仅是一个 ASP.Net AJAX 控件,它是一个可以添加到你的 Web 页面中去; 简单的操作,就可以使你的页面具有动画的效果。

它可以使得你页面上的控件,在某一个特定的事件中呈现动画效果,例如,OnLoad、OnClick、OnMouseOver 或者 OnMouseOut 等等。

案例代码

<asp:Button ID="target" runat="server" Text="Animate Me" OnClientClick="return false;"></asp:Button>
    <ajaxToolkit:AnimationExtender ID="extender" runat="server" TargetControlID="target">
            <Animations>
                <OnLoad><StyleAction Attribute="backgroundColor" Value="red" /></OnLoad>
                <OnClick><StyleAction Attribute="backgroundColor" Value="blue" /></OnClick>
                <OnMouseOver><StyleAction Attribute="backgroundColor" Value="blue" /></OnMouseOver>
                <OnMouseOut><StyleAction Attribute="backgroundColor" Value="green" /></OnMouseOut>
                <OnHoverOver><StyleAction Attribute="color" Value="blue" /></OnHoverOver>
                <OnHoverOut><StyleAction Attribute="color" Value="yellow" /></OnHoverOut>
            </Animations>
    </ajaxToolkit:AnimationExtender>