VS 2013和日历扩展程序的Ajax html编辑器问题来自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编辑器的问题。
答案 0 :(得分:0)
删除master中的scriptmanager并将其添加到内容页面
安装AjaxControlToolkit.HtmlEditor.Sanitizer,与Html Sanitizer一起使用Html编辑器
代码段
<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