uid | title | author | description | ms.author | ms.date | ms.assetid | msc.legacyurl | msc.type |
---|---|---|---|---|---|---|---|---|
web-forms/overview/ajax-control-toolkit/animation/modifying-animations-from-the-server-side-cs |
Modifying Animations From The Server Side (C#) | Microsoft Docs |
wenz |
The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. The animations may also... (C#) |
riande |
06/02/2008 |
b0abec39-a1c9-422d-ba9a-ef16f6185af8 |
/web-forms/overview/ajax-control-toolkit/animation/modifying-animations-from-the-server-side-cs |
authoredcontent |
The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. The animations may also be changed on the server-side
The Animation control in the ASP.NET AJAX Control Toolkit is not just a control but a whole framework to add animations to a control. The animations may also be changed on the server-side
First of all, include the ScriptManager
in the page; then, the ASP.NET AJAX library is loaded, making it possible to use the Control Toolkit:
[!code-aspxMain]
The animation will be applied to a panel of text which looks like this:
[!code-aspxMain]
In the associated CSS class for the panel, define a nice background color and also set a fixed width for the panel:
[!code-cssMain]
The rest of the code runs on the server-side and does not use markup; instead, it uses code to create the AnimationExtender
control:
[!code-aspxMain]
However, the Control Toolkit currently does not provide an API access to create the individual animations. It is however possible to set the AnimationExtender
's Animations property to a string containing the XML markup used when assigning the animations declaratively. In order to create the XML which must not contain the <Animations>
element you could use the .NET Framework's XML support or, as in the following code, just provide the string:
[!code-cssMain]
Finally, add the AnimationExtender
control to the current page, within the <form runat="server">
element, making sure that the animation is included and runs:
[!code-htmlMain]
The animation is created using server-side C#/VB code (Click to view full-size image)