需要添加如下配置:
Add this to web config
<configuration><configSections><sectionGroupname="system.web"><sectionname="sanitizer"requirePermission="false"type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit"/></sectionGroup></configSections><system.web><sanitizerdefaultProvider="HtmlAgilityPackSanitizerProvider"><providers><addname="HtmlAgilityPackSanitizerProvider"type="AjaxControlToolkit.Sanitizer.HtmlAgilityPackSanitizerProvider"></add></providers></sanitizer></system.web></configuration>