简体   繁体   English

ASP.NET Ajax和“无法加载类型”

[英]ASP.NET Ajax and “could not load type”

I have an ASP.NET web page with an Ajax file upload control. 我有一个带有Ajax文件上传控件的ASP.NET网页。 When I try to run my page, I'm told "Could not load type 'AjaxControlToolkit.AjaxFileUploadHandler' from assembly 'AjaxControlToolkit'." 当我尝试运行我的页面时,被告知“无法从程序集“ AjaxControlToolkit”中加载类型'AjaxControlToolkit.AjaxFileUploadHandler'。”

Here's my control: 这是我的控制权:

<ajaxtoolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server" />

Here's the relevant stuff in my web.config: 这是我的web.config中的相关内容:

<system.web>
    <httpHandlers>
        <add verb="*" path="AjaxFileUploadHandler.axd"
            type="AjaxControlToolkit.AjaxFileUploadHandler, 
            AjaxControlToolkit"/>
    </httpHandlers>
    <pages>
        <controls>
            <add tagPrefix="ajaxtoolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolKit"/>
        </controls>
    </pages>
</system.web>

Here's my error message: 这是我的错误信息:

错误信息

I'm running this app on Win Server 2k3 and IIS 6 and ASP.NET 4. It appears that my toolkit is the correct version. 我正在Win Server 2k3,IIS 6和ASP.NET 4上运行此应用程序。看来我的工具箱是正确的版本。

I feel like it's probably a simple mistake, but I can't seem to find it. 我觉得这可能是一个简单的错误,但似乎找不到。 Let me know if more info is helpful. 让我知道更多信息是否有帮助。 Thanks! 谢谢!

Jeremy 杰里米

This is a common problem. 这是一个普遍的问题。 Do a search for deleting ASP temporary files. 搜索删除ASP临时文件。 If that does not solved it, sometimes a reinstall of Ajax using package manager sometimes resolved it. 如果仍不能解决问题,有时使用软件包管理器重新安装Ajax有时可以解决问题。

Even I had this error 即使我有这个错误

Well, I solved by removing AjaxFileUploadHandler fro Web.Config file: 好吧,我通过从Web.Config文件中删除AjaxFileUploadHandler来解决:

<configuration>
    <system.webServer>
        <handlers>
            <!--add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/-->
        </handlers>
    </system.webServer>
    <system.web>
        <httpHandlers>
            <!--add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/-->
        </httpHandlers>
    </system.web>
</configuration>

This solved my error above. 这解决了我上面的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.net c# - 无法加载类型 - ASP.net c# - Could not load type ASP.net&C#&无法加载类型 - ASP.net & C# & Could not load type 执行时ASP.Net MVC“无法加载类型” - ASP.Net MVC “Could Not Load Type” when executing 无法加载文件或程序集asp.net - Could not load file or assembly asp.net ASP.net无法加载文件或程序集 - ASP.net Could not load file or assembly ASP.NET错误:System.TypeLoadException无法加载字段类型&#39;Microsoft.Owin.Security.ActiveDirectory - ASP.NET Error: System.TypeLoadException Could not load type of field 'Microsoft.Owin.Security.ActiveDirectory ASP.NET Core错误:System.TypeLoadException:无法加载类型&#39;Microsoft.AspNetCore.WebUtilities.FileBufferingWriteStream&#39; - ASP.NET Core Error: System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.WebUtilities.FileBufferingWriteStream' Asp.net-无法加载类型&#39;MyNameSpace.Reporting.UI._Default&#39; - Asp.net - Could not load type 'MyNameSpace.Reporting.UI._Default' VS2013 ASP.NET无法加载类型&#39;[解决方案]。[应用程序]&#39; - VS2013 ASP.NET Could not load type '[solution].[application]' ASP.NET C#嵌套应用程序(子目录)-解析器错误消息:无法加载类型 - ASP.NET C# Nested application (sub directory) - Parser Error Message: Could not load type
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM