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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Saving on browser back or refresh

Thread ID:





149290 Nov 20,2019 07:18 PM UTC Nov 21,2019 11:50 AM UTC Blazor 1
Tags: In-place Editor
Ivan Petrov
Asked On November 20, 2019 07:18 PM UTC


How can I save the content of the editor when somebody clicks the browser back or refresh. Currently, when I click outside of the component it saves the new value, however that is not true for the mentioned cases.


Pandiyaraj Muniyandi [Syncfusion]
Replied On November 21, 2019 11:50 AM UTC

Hi Krasimir, 
Greetings from Syncfusion support. 
We have validated your requirement and its default functionality of browser. We can achieve this requirement from application end by calling In-place Editor - save() public method in JavaScript window.onbeforeunload event callback as follows. 
Note: onbeforeunload trigger when leaving from current page (refresh too). 
Add index.js file with below code blocks and save it in wwwroot folder of your application. Then add this JS file reference into _host.cshtml 
window.onbeforeunload = function () { 
    var editorObj = document.getElementById('TextEditor').ej2_instances[0]; 
    if (editorObj.enableEditMode) { // To ensure whether editor in ediable mode 
        editorObj.save(); // Save the editor current value 
We have prepared sample for your reference, get it from below link 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon