Could not load type 'AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider'.

前端 未结 4 1714
天涯浪人
天涯浪人 2020-12-01 22:37

I tried to use htmleditorextender but I am getting error. below are my settings

<%@ Register Assembly=\"AjaxControlToolkit\" Namespace=\"AjaxControlToolki         


        
相关标签:
4条回答
  • 2020-12-01 22:58

    Having searched high and low for the same problem to be solved, I worked out that the Ajax Control Kit also needed to be loaded via the Library Package Manager...

    PM > Install-Package AjaxControlToolkit

    This solved the problem for me.

    0 讨论(0)
  • 2020-12-01 23:02

    It's recommended that you download the latest Html Agility Pack from here : http://htmlagilitypack.codeplex.com/ and place in your bin and add reference to it in your project.

    Or use the install command :

    PM> Install-Package HtmlAgilityPack

    you may look at this link http://nuget.org/packages/HtmlAgilityPack

    You don't have to use or reference to AntiXSSLibrary just use the HtmlAgilityPackSanitizerProvider and your error will disappear

    Good luck

    0 讨论(0)
  • 2020-12-01 23:22

    Using AntiXss as the default sanitizer is no longer supported as of June 2012. From the official announcement, apparantely the new version of AntiXss breaks too many things.

    To use AjaxControlToolkit with HTML Agility Pack you first need to install the pacakge using Nuget (instruction).

    Then you can use HTML Agility Pack as your sanitizer by modifying your web.config like this:

    <configuration>
        <configSections>
            <sectionGroup name="system.web">
                <section name="sanitizer" requirePermission="false"
                         type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit" />
            </sectionGroup>
        </configSections>
    
        <system.web>
            <sanitizer defaultProvider="HtmlAgilityPackSanitizerProvider">
                <providers>
                    <add name="HtmlAgilityPackSanitizerProvider" type="AjaxControlToolkit.Sanitizer.HtmlAgilityPackSanitizerProvider"></add>
                </providers>
            </sanitizer>
          </system.web>
    </configuration>
    

    Hope this helps.

    0 讨论(0)
  • 2020-12-01 23:22

    HTML Agility Pack must be installed for all new versions of Ajax Control Toolkit. Unfortunetly a lot of answers in the web are wrong

    0 讨论(0)
提交回复
热议问题