类型或命名空间名称“ToolkitScriptManager”在命名空间“AjaxControlToolkit”中不存在

本文关键字:命名空间 AjaxControlToolkit 不存在 类型 ToolkitScriptManager | 更新日期: 2023-09-27 17:57:00

 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileUpload.aspx.cs" Inherits="Test.FileUpload" %>
 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<div>
        <ajaxToolkit:ToolkitScriptManager id="scriptManager1" runat="server" />
        <div>
            <ajaxToolkit:AsyncFileUpload runat="server" id="fileUpload1" onclientuploadcomplete="uploadComplete" onclientuploaderror="uploadError"
                completebackcolor="White" width="350px" uploaderstyle="Modern" uploadingbackcolor="#CCFFFF"
                throbberid="imgLoad" onuploadedcomplete="fileUploadComplete"></ajaxToolkit:AsyncFileUpload>
            <br />
            <asp:Image ID="imgLoad" runat="server" ImageUrl="loading.gif" />
            <br />
            <asp:Label ID="lblMsg" runat="server" Text=""></asp:Label>
        </div>
     </div> 

我已经安装了AjaxControlToolKit,添加了对它的引用,将这些控件添加到工具箱中。 ajaxToolkit:AsyncFileUpload是可识别的。但是,我正在为ajaxToolkit:ToolkitScriptManager"The type or namespace name 'ToolkitScriptManager' does not exist in the namespace 'AjaxControlToolkit' (are you missing an assembly reference?)".

如何解决?

类型或命名空间名称“ToolkitScriptManager”在命名空间“AjaxControlToolkit”中不存在

添加 ScriptManager AS

    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <ajaxtoolkit:AsyncFileUpload runat="server" ID="fileUpload1" OnClientUploadComplete="uploadComplete"
                OnClientUploadError="uploadError" CompleteBackColor="White" Width="350px" UploaderStyle="Modern"
                UploadingBackColor="#CCFFFF" ThrobberID="imgLoad" OnUploadedComplete="fileUploadComplete">
            </ajaxtoolkit:AsyncFileUpload>
            <br />
            <asp:Image ID="imgLoad" runat="server" ImageUrl="loading.gif" />
            <br />
            <asp:Label ID="lblMsg" runat="server" Text=""></asp:Label>
        </div>
    </div>