Search code examples
ajaxanimationasp.net-ajaxajaxcontroltoolkit

AJAX - Animation extender


I am using VS 2010 to create a simple animation, however run-time getting following error!!

Please help me to proceed further !!

Parser Error Message: The base class includes the field 'ToolkitScriptManager1', but its type (AjaxControlToolkit.ToolkitScriptManager) is not compatible with the type of control (AjaxControlToolkit.ToolkitScriptManager).

Source Error:

 <form id="form1" runat="server">
<div>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">  
 </asp:ToolkitScriptManager>

Source File: /HomeLoggedin.aspx Line: 23


Source code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HomeLoggedin.aspx.cs" Inherits="TheEncyclopediaOnlineLibrary.HomeLoggedin" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Animation</title>
   <style type="text/css">  

    #Message {  
        width: 250px;  
        padding: 10px;     
        margin-bottom:10px;  
    }  

    </style>  
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">  
        </asp:ToolkitScriptManager> 

        <asp:Panel ID="Message" runat="server">  
            Pay attention to me!  
        </asp:Panel> 

        <asp:LinkButton ID="lnkYellowFade" OnClientClick="return false;" runat="server">Play Animation</asp:LinkButton>

        <asp:AnimationExtender ID="AnimationExtender1" TargetControlID="lnkYellowFade" runat="server">  
            <Animations>  
                <OnClick>  
                    <Sequence>  
                    <Color   
                        AnimationTarget="Message"   
                        Duration="2"   
                        Property="style"   
                        PropertyKey="backgroundColor"  
                        StartValue="#FFFF66"   
                        EndValue="#FFFFFF" />   
                    </Sequence>  
                </OnClick>  
            </Animations>  
    </asp:AnimationExtender>

    </div>
    </form>
</body>
</html>

Solution

  • I had the wrong version of the Ajax toolkit referenced in the project. Once I change the dll refernce to required version, got rid of the error...