AJAX AnimationExtender

V

vcuankitdotnet

Hi. I have been trying to get the AnimationExtender to work and resize
my div onclick of a button. I am using ASP.NET 2.0. Here is my code
which is used inside a masterpage:

<%@ Register Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>

<script language="javascript" type="text/javascript">
function CreateInstanceAndPlayAnimation()
{
var changeColorAnimation =
AjaxControlToolkit.Animation.ResizeAnimation($get('changingInfoDiv'),
0.2 , 45 , 200 , 100 , "px");
changeColorAnimation.play();
}
</script>

<div runat="server" id="changingInfoDiv" style="width:50px; height:
150px; background-color:#000000;">
hello, this is my div
</div>
<input type="button" value="Create Instance And Play"
onclick="CreateInstanceAndPlayAnimation();" />
<asp:ScriptManager runat="server" id="scriptmanager1"></
asp:ScriptManager>

<ajaxToolkit:AnimationExtender ID="AnimationExtender1" runat="server"
TargetControlID="changingInfoDiv"
BehaviorID="ChangingInfoDivBehavior">
<Animations>
<OnClick>
<Resize height="100" width="200" duration ="0.2"
fps="45" unit="px"></Resize>
</OnClick>
</Animations>
</ajaxToolkit:AnimationExtender>


I am getting the following javascript error message when clicking the
button:
Error: Sys.ArgumentTypeException: Object of type 'Object' cannot be
converted to type 'AjaxControlToolkit.Animation.ResizeAnimation'.
Paramter name: instance



Any help would be greatly appreciated. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top