1

I am getting the "The Sanitizer is not configured in the web.config file. Either install the AjaxControlToolkit.HtmlEditor.Sanitizer NuGet package or set the EnableSanitization property to False (insecure)." error message that a lot of people are getting.

A lot of answers I am finding say to download files, but because the AJAXControlToolKit project has been moved to devexpress, most links are outdated.

Tried to follow the answers provided to this question, but the links provided to download the necessary dlls are outdated.

So I followed this page to install the packages by typing

Install-Package AjaxControlToolkit.HtmlEditor.Sanitizer -Version 17.1.1.  

So it dumps two packages: HtmlAgilityPack.1.4.9 and AjaxControlToolkit.HtmlEditor.Sanitizer.17.1.1.0.

Before that, I physically downloaded the dlls from here.

After making references to the DLLs, I tried to follow instructions on this page to fix the web.config file. But two issues

  • AjaxControlToolkit.Sanitizer.ProviderSanitizerSection cannot be resolved.

  • sanitizer is not a valid child element of system.web

The github page on the extender says nothing about modifying the web.config file.

I probably chased around other sites on this issue, but I can't list them all, and it's 2:50 AM and I am at my wit's end.

I know that the AjaxControlToolkit project has been moved to devexpress, but documentation seems to be very hard to find.

EDIT: I do have AjaxControlToolkit installed and have 3-4 controls from it working on my web site.

user79284
  • 175
  • 1
  • 2
  • 18

1 Answers1

2

It's hard to say for sure what is gone wrong in this case, but AjaxControlToolkit.HtmlEditor.Sanitizer should work out-of-the-box.

You need is to install Nuget packages AjaxControlToolkit and AjaxControlToolkit.HtmlEditor.Sanitizer of the same version. You can do that even if you already installed AJAX Control Toolkit via the installer.

Then, check your Web.config. This line should be presented there:

<ajaxControlToolkit htmlSanitizer="AjaxControlToolkit.HtmlEditor.Sanitizer.DefaultHtmlSanitizer, AjaxControlToolkit.HtmlEditor.Sanitizer" />

You can look at the Sample Site source code to check how complete Web.config file should look like.

  • The old AjaxToolKit site had a fully functional sample project that worked out of the box. Is there something similar to that? – user79284 Oct 06 '17 at 17:18
  • Yes, you can download the whole repo https://github.com/DevExpress/AjaxControlToolkit and open the project `AjaxControlToolkit.SampleSite` there. – MikhailTymchukDX Oct 10 '17 at 09:56