AJAX - 动画扩展器
我正在使用 VS 2010 创建一个简单的动画,但是运行时出现以下错误!
请帮助我继续前进!
解析器错误消息:基类包含字段“ToolkitScriptManager1”,但其类型 (AjaxControlToolkit.ToolkitScriptManager) 与控件类型 (AjaxControlToolkit.ToolkitScriptManager) 不兼容。
源错误:
<form id="form1" runat="server">
<div>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
源文件:/HomeLoggedin.aspx 行:23
源代码
<%@ 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>
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>
我在项目中引用的 Ajax 工具包版本错误。一旦我将 dll 引用更改为所需版本,就消除了错误......
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...