我正在尝试使用 AjaxToolKit 编辑器,但是当我查看页面时,我收到一条错误消息,指出控件未正确加载。
由于我不确定缺少什么,因此我不确定在这篇文章中要提供多少信息。如果我可以提供其他可能指向问题的东西,请提出建议,我会添加它。
我的错误信息:
Could not load control AjaxControlToolkit.HTMLEditor.Editor. The
script reference(s) of this control was not loaded correctly. If
AjaxControlToolkit.config is used, probably this control is not
registered properly. Description: An unhandled exception occurred
during the execution of the current web request. Please review the
stack trace for more information about the error and where it
originated in the code. Exception Details: System.Exception: Could
not load control AjaxControlToolkit.HTMLEditor.Editor. The script
reference(s) of this control was not loaded correctly. If
AjaxControlToolkit.config is used, probably this control is not
registered properly. Source Error: An unhandled exception was
generated during the execution of the current web request. Information
regarding the origin and location of the exception can be identified
using the exception stack trace below. Stack Trace: [Exception:
Could not load control AjaxControlToolkit.HTMLEditor.Editor. The
script reference(s) of this control was not loaded correctly. If
AjaxControlToolkit.config is used, probably this control is not
registered properly.]
AjaxControlToolkit.ToolkitScriptManager.OnPreRender(EventArgs e) +387
System.Web.UI.Control.PreRenderRecursiveInternal() +83
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+974
我的 HTML:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="UACWeb.WebForm1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolKitTag" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>TEST</title>
</head>
<body>
<form id="form1" runat="server">
<AjaxToolKitTag:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="false"></AjaxToolKitTag:ToolkitScriptManager>
<cc1:Editor ID="Editor1" runat="server" />
</form>
</body>
</html>
我的 Web.config 的 Controls 部分:
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
我没有 AjaxControlToolkit.config 文件。