Why RTE becomes blank after postback in FireFox browser
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.
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.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|
|8463||02/20/2018||02/20/2018||ASP.NET Web Forms||RichTextEditor|