gpt4 book ai didi

c# - 错误 "Sanitizer provider is not configured in the web.config file. "

转载 作者:太空狗 更新时间:2023-10-30 01:21:35 35 4
gpt4 key购买 nike

我想使用 ajaxtoolkit 中的 htmleditor。我已经从 this link 下载了工具包

Ajax 控制工具包 .NET 3.5

但是出现错误,因为“Sanitizer 提供程序未在 web.config 文件中配置。如果您在公共(public)网站上使用 HtmlEditorExtender,请配置 Sanitizer 提供程序。否则,将 EnableSanitization 属性设置为 false。

.aspx

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="txtBox1">
</asp:HtmlEditorExtender>
<asp:TextBox runat="server" ID="txtBox1" TextMode="MultiLine" Columns="50" Rows="10"
Text="Hello <b>world!</b>" />

我搜索了很多网站..我得到下面的代码作为添加到 web.config 中的解决方案但是出现“Could not load type 'AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider”这样的错误。还有一行字sanitizer

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

AjaxControltoolkit

enter image description here

sanitizer 供应商文件夹

enter image description here

最佳答案

使用以下行更改 web.config 中的 sanitizer 部分并尝试:

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

关于c# - 错误 "Sanitizer provider is not configured in the web.config file. ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15150498/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com