0

I'm editing the original post because I've figured a few things out, so my question can be more specific.

I'm working with the AjaxControlToolkit and Visual Studio 2015 Community edition. I used NuGet to install the toolkit and the Html Sanitizer they suggested.

Now, I set up a web forms ASP.NET page containing the HtmlEditorExtender control, and it works fine except for the embedded AjaxFileUpload control.

The upload is failing, and I included the console output below to show what I get.

Console Log Messages

It appears that the error comes because the app can't find the AjaxFileUploadHandler.axd file (that's what the more descriptive version of the console message is). I tried all of the suggestions I could find about modifying the web.config file (here are the relevant sections):

  <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>

and...

<system.web>
<trust level="Full" />
<httpHandlers>
  <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
</httpHandlers>

I've uninstalled the toolkit, rebooted the server, tried everything I could find on it, and yet still no joy. I'm out of ideas here. Any help from anyone, please?

Daniel Anderson
  • 275
  • 3
  • 16

2 Answers2

2

If you host your application no at the root of a web site, you need to specify a path to the AjaxFileUploadHandler.axd that includes all path parts after the site root.

For example, if you host a site at http://mysite/myapp/mypage.aspx you need to define it like that:

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

You can also see this issue for more details: https://github.com/DevExpress/AjaxControlToolkit/issues/43#issuecomment-203889967

Mikhail Tymchuk
  • 886
  • 4
  • 8
  • I did try that, and it still gives me the same error. I read that article (and your suggestions) yesterday before I posted this, hoping maybe it would work, but it didn't. Even after changing the path in the web.config, the console output shows it still trying to look in the localhost root. Also, in Visual Studio, the output of the build says it cannot find the schema for the element 'ajaxControlToolkit'. Could you perhaps provide a more complete example of what the web.config should look like so I can see if mine's missing something? I installed everything via NuGet. – Daniel Anderson Jun 14 '16 at 17:55
  • It's hard to guess what can go wrong. Could you please share your sample project with the problem described? – Mikhail Tymchuk Jun 17 '16 at 07:53
  • Is there any chance you could rovide a full working example with web.config? I'verun totally out of things to try with this. – Daniel Anderson Jun 25 '16 at 03:51
1

Please check that Identity under which you are executing your code has access to the folder.

I encountered the same error, the solution worked fine on local dev machine but when i published it onto server, I got this same error.

Looking at Event logs on the server I realized that i missed to give r/w permissions to the server identity. Once i gave these permissions, it worked fine.

Satbir
  • 311
  • 3
  • 5