We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

RTE's postback issue on Firefox browser

Why RTE becomes blank after postback in FireFox browser

 

Root Cause:

In RTE control a contenteditable Iframe is used for editing it’s content. The FireFox browser does not work properly with dynamically rendered contenteditable iframes after postback. Since this is a browser related issue, queries have been raised in various online forums. Refer to the following links.

https://support.mozilla.org/en-US/questions/1150739

https://forum.jquery.com/topic/while-create-a-content-editable-iframe-dynamically-getting-rendering-issues-in-firefox

Workaround:

This issue can be overcome by storing the Iframe’s content to the browser’s local storage during postback and then restoring them back via control’s create event after the postback completes.

Consider the following example.

 

In the above code, RTE is placed inside an UpdatePanel control for postback and the button control is used to perform the postback. Using its ClientSideOnClick event, the iframe’s content is stored in browser’s local storage during postback. Refer to the following code.

 

 Now the content is set to the local storage, so once the postback completes, the content from the local storage is set back to the control using the ClientSideOnCreate event. Refer to the following code.

 

To prevent the content from the local storage, from being inserted into the control during initial render or full-page refresh, it must be removed. Refer to the following code.

 

Sample Link

Article ID: Published Date: Last Revised Date: Platform: Control:
8463 02/20/2018 02/20/2018 ASP.NET Web Forms RichTextEditor
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.