简体   繁体   English

HTMLEditorExtender无法在Server.Transfer上正确加载

[英]HTMLEditorExtender does not correctly load on Server.Transfer

I'm writing a web application that utilizes HTMLEditorExtender. 我正在编写一个利用HTMLEditorExtender的Web应用程序。 I invoke it using the following code: 我使用以下代码调用它:

    <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>

NOTE: I know it's bad to set EnableSanitization="false", but this application will only be used privately. 注意:我知道设置EnableSanitization =“ false”是很不好的,但是此应用程序将仅私下使用。

With that code, when the page loads, the text box looks like this: 使用该代码,当页面加载时,文本框如下所示:

That looks good! 这看起来不错!

But, in my application, I navigate to another page and then need to navigate back to this page using Server.Transfer(page_URL). 但是,在我的应用程序中,我导航到另一个页面,然后需要使用Server.Transfer(page_URL)导航回到该页面。 When I do that, the HTMLEditorExtender no longer loads correctly and I get something that looks like this: 当我这样做时,HTMLEditorExtender不再正确加载,并且我得到如下所示的内容:

How can I get it to load correctly on Server.Transfer()? 我如何才能将其正确加载到Server.Transfer()上? I'm thinking that it may be a simply flag I need to invoke on the creation of the HTMLEditorExtender element, but I've tried a few and can't get anything to work. 我认为这可能只是我在创建HTMLEditorExtender元素时需要调用的一个简单标志,但是我尝试了一些,却无济于事。

EDIT: I should add that I am using IE 8 and it must work in IE 8. 编辑:我应该补充一点,我正在使用IE 8,它必须在IE 8中工作。

I changed stopped using Server.Transfer() and decided to set the PostBackUrl in the ASP. 我更改为停止使用Server.Transfer(),并决定在ASP中设置PostBackUrl。 For some reason, this worked. 由于某种原因,这行得通。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM