Ajax html 编辑器 VS 2013 的问题

Ajax html editor an issue with VS 2013

Ajax html VS 2013 和日历扩展器的编辑器问题来自 Ajax 但 Ajax html 编辑器未显示的问题甚至设计模式。

Ajax html 编辑器在设计模式消息中显示如下:

HtmlEditorExtender - Unnamed1

以下是我的网络配置详细信息:

<pages>
  <namespaces>
    <add namespace="System.Web.Optimization" />
    <add namespace="Microsoft.AspNet.Identity" />
  </namespaces>
  <controls>
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
    <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
    <add tagPrefix="asp" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
    <add tagPrefix="cc1" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />

  </controls>
</pages>

下面是我的内容占位符页面:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<ajaxToolkit:HtmlEditorExtender TargetControlID="txt_largedesc" runat="server" />

下面是我的母版页脚本管理器:

<asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>

            <asp:ScriptReference Name="MsAjaxBundle" />
            <asp:ScriptReference Name="jquery" />
            <asp:ScriptReference Name="bootstrap" />
            <asp:ScriptReference Name="respond" />
            <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
            <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
            <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
            <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
            <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
            <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
            <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
            <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
            <asp:ScriptReference Name="WebFormsBundle" />

        </Scripts>
</asp:ScriptManager>

Calender Extender 来自 Ajax 工具包,但 Ajax html 编辑器出现问题。

  1. 删除 master 中的 scriptmanager 并将其添加到内容页面

  2. 安装 AjaxControlToolkit.HtmlEditor.Sanitizer,将 Html Editor 与 Html Sanitizer

  3. 一起使用
  4. 代码片段

     <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    
     <asp:TextBox ID="txtEditor" runat="server" Width="300" Height="200" />
     <ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="txtEditor"></ajaxToolkit:HtmlEditorExtender>
    
     <asp:Button Text="Submit" runat="server" OnClick="Submit" />
    
     <br />
    
     <asp:Label ID="lblContents" runat="server" />
    

隐藏代码

 protected void Submit(object sender, EventArgs e)
 {
   lblContents.Text = txtEditor.Text;
 }

参考:ASP.Net AJAX 控件工具包 HtmlEditorExtender 示例 http://www.aspsnippets.com/Articles/ASPNet-AJAX-Control-Toolkit-HtmlEditorExtender-Example.aspx