Back and Forward Browser Buttons Display Raw HTML in the Editor
Environment
Product | Progress® Kendo UI® Editor for jQuery |
Operating System | Windows 10 64bit |
Description
The Back and Forward browser buttons display raw HTML in the jQuery Editor.
Cause
By default, the Editor stores its value encoded. When the page is retrieved from the bfcache
(back-forward cache), the textarea
value is persisted as encoded and the Editor encodes it again. This process can be easily observed if you navigate several times back and forth. On each navigation, the Editor value is encoded once more.
Solution
Set the encoded
property to false
. The value of the Editor is expected to be posted unencoded to the server.
If you are using ASP.NET, make sure that you either disable the ASP.NET security validation or set the AllowHtml
attribute on the model field that will receive the HTML string. For more information, refer to the documentation on requesting validation in ASP.NET.
Another option is to enable the inline Editor mode which does not use an iframe
and a textarea
. In this case, however, you have to manually submit the value of the Editor.
The back-forward cache of the browser can be disabled by attaching a window.unload
handler, as demonstrated in the following example.
$(window).unload(function() {
// nothing required here
});