未能加载类型AjaxControlToolkit.Sanitizer.AntiXssSanitize

2019-10-18 09:54发布

我想用我的asp网站htmleditorextender,这是我在.aspx文件中:

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
<asp:TextBox ID="txtContent" runat="server" Width="400px" Heigh="400px" />
<asp:HtmlEditorExtender ID="hex" runat="server" TargetControlID="txtContent">
</asp:HtmlEditorExtender>

我web.conf设置为:

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

  <system.web>

    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.0"/>

    <sanitizer defaultProvider="HtmlAgilityPackSanitizerProvider">
      <providers>
        <add name="HtmlAgilityPackSanitizerProvider" type="AjaxControlToolkit.Sanitizer.HtmlAgilityPackSanitizerProvider"></add>
      </providers>
    </sanitizer>


  </system.web>
</configuration>

我还安装了HtmlAgilityPack(尝试了最新的版本,1.4版本)。

但仍然收到此错误:

未能加载类型“AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider”。

另外随着加入AntiXSSLibrary.dll和SanitizerProviders.dll尝试过,但仍然无法正常工作(如果在需要他们不知道)。

我究竟做错了什么?

我想这也: 未能加载类型“AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider”。

文章来源: Could not load type AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider