【发布时间】:2012-11-01 15:43:39
【问题描述】:
我正在编写一个使用 HTMLEditorExtender 的 Web 应用程序。我使用以下代码调用它:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true" />
<asp:TextBox ID="htmlTextBox" runat="server" TextMode="Multiline" Width="90%" Rows="25" />
<asp:HtmlEditorExtender ID="htmlEditorExtender" TargetControlID="htmlTextBox" runat = "server" EnableSanitization="false" >
<Toolbar>
<asp:Undo />
<asp:Redo />
<asp:Bold />
<asp:Italic />
<asp:Underline />
<asp:ForeColorSelector />
<asp:FontNameSelector />
<asp:FontSizeSelector />
<asp:JustifyLeft />
<asp:JustifyCenter />
<asp:JustifyRight />
<asp:JustifyFull />
<asp:InsertOrderedList />
<asp:InsertUnorderedList />
<asp:CreateLink />
<asp:UnLink />
</Toolbar>
</asp:HtmlEditorExtender>
注意:我知道设置 EnableSanitization="false" 是不好的,但这个应用程序只能私下使用。
使用该代码,当页面加载时,文本框如下所示:
看起来不错!
但是,在我的应用程序中,我导航到另一个页面,然后需要使用 Server.Transfer(page_URL) 导航回该页面。当我这样做时,HTMLEditorExtender 不再正确加载,我得到如下所示的内容:
如何让它在 Server.Transfer() 上正确加载?我在想它可能是一个简单的标志,我需要在创建 HTMLEditorExtender 元素时调用,但我尝试了一些,但没有任何效果。
编辑:我应该补充一点,我使用的是 IE 8,它必须在 IE 8 中工作。
【问题讨论】:
-
在 FireFox 中使用 FireBug,您是否看到任何脚本或其他请求被拒绝?
-
@Brian 使用 firefox,应用程序有不同的视觉错误。左上角带有“取消”的白框不存在。它只是一个空的文本框。我在 firebug 中看到的唯一可能有用的是“TypeError: Sys.Extended is undefined”。
标签: asp.net htmleditorextender