AjaxControlToolkit: error loading event completion and starting a new download

When using AjaxControlToolkit in April 2013, I get an error message:

0x800a139e - JavaScript runtime error: error loading event completion and starting a new download

When trying to upload a file using the AjaxFileUpload control.

+6
source share
6 answers

To fix this error, you need to add this

<httpHandlers> <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/> </httpHandlers> 

in

 <system.web> 

your website

+5
source

Verify that the following items are present in web.config. here is the updated notice http://ajaxcontroltoolkit-7-0123-breaks-vs20.15851857.ccqq.net/

 <configuration> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" maxRequestLength="42949672" /> <httpHandlers> <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/> </httpHandlers> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <handlers> <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/> </handlers> <security> <requestFiltering> <requestLimits maxAllowedContentLength="4294967295"/> </requestFiltering> </security> </system.webServer> </configuration> 
+14
source

If your application pool is set to classic, this will happen if you do not use precondition = "integratedMode" added to httphandler for system.webserver

 <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" preCondition="integratedMode"/> 
+3
source

There was the same problem after switching to 4.5. The proposed solution did not work until I added the full name assemply:

 <httpHandlers> <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit, Version=4.5.7.725, Culture=neutral, PublicKeyToken=28F01B0E84B6D53E" /> </httpHandlers> 

It turns out that if you have version 3.5 in the "old" gac and 4.5 in the new Microsoft.net/assembly gac file, your webapp (IIS?) Will not choose the right one !?

+1
source

Since my application uses forms authentication, I added this to my web.config to start ajaxfileupload:

 <location path="AjaxFileUploadHandler.axd"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> 
0
source

If anyone else encounters a problem even after the changes mentioned by @sridharnetha, try including the following lines.

It is important to add UseAbsoluteHandlerPath = "false"

  <ajax:AjaxFileUpload ID="AjaxFileUpload11" runat="server" MaximumNumberOfFiles="3" AllowedFileTypes="txt,xls,xlsx,doc,docx,pdf" Width="400px" UseAbsoluteHandlerPath ="false" OnUploadComplete="OnUploadComplete" OnClientUploadStart="UploadStart" OnClientUploadCompleteAll="UploadComplete" ClearFileListAfterUpload="true" OnClientUploadError="UploadError"/> 

In web.config

  <httpHandlers> <add verb="*" path="http://localhost/AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" /> </httpHandlers> 
0
source

Source: https://habr.com/ru/post/946087/


All Articles