<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><ajaxToolkit:ToolkitScriptManagerID="ToolkitScriptManager1"runat="server">
</ajaxToolkit:ToolkitScriptManager>
<asp:TextBox ID="TxtEditor" runat="server"/>
<ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="TxtEditor">
</ajaxToolkit:HtmlEditorExtender>
<br/>
<asp:Button runat="server" Text="Submit" OnClick="Submit"/>
</form>
这是设计页面,我添加&#34;&lt;%@ Register Assembly =&#34; AjaxControlToolkit&#34;命名空间=&#34; AjaxControlToolkit&#34;的TagPrefix =&#34; ASP&#34; %GT;&#34;在页面顶部
protected global::AjaxControlToolkit.HtmlEditorExtender HtmlEditorExtender1;
我在这一行上收到错误。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.web">
<section name="sanitizer" requirePermission="false" type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit" />
</sectionGroup>
<section name="ajaxControlToolkit" type="AjaxControlToolkit.AjaxControlToolkitConfigSection, AjaxControlToolkit" /></configSections>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<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>
<sanitizer defaultProvider="HtmlAgilityPackSanitizerProvider">
<providers>
<add name="HtmlAgilityPackSanitizerProvider" type="AjaxControlToolkit.Sanitizer.HtmlAgilityPackSanitizerProvider"></add>
</providers>
</sanitizer>
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages></system.web>
<ajaxControlToolkit htmlSanitizer="AjaxControlToolkit.HtmlEditor.Sanitizer.DefaultHtmlSanitizer, AjaxControlToolkit.HtmlEditor.Sanitizer" />
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="AjaxControlToolkit" publicKeyToken="28f01b0e84b6d53e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.20229.24049" newVersion="1.0.20229.24049" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
这是我的web.config页面
答案 0 :(得分:1)
使用“asp”标记前缀注册“AjaxControlToolkit”命名空间,但使用“ajaxToolkit”前缀访问HtmlEditorExtender。 无处不在,将其改为“ajaxToolkit”。