Skip to content

Commit 9e732c2

Browse files
author
Marin Bratanov
authored
minor style fixes
1 parent b937df3 commit 9e732c2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

controls/editor/how-to/preserve-content-on-back-button.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ position: 11
1010

1111
# Preserve the Content in RadEditor when Using Back Button
1212

13-
**RadEditor UI for ASP.NET AJAX** looses its content when user navigates out of the page and comes back by using the **Back** button of the browser. Browsers automatically preserve the content in such scenario only for form elements like `<textarea>`, `<input/>` and so on. **RadEditor**, however, is an editable DOM element that the browser does not consider as a form element field so to preserve its contents automatically.
13+
**RadEditor for ASP.NET AJAX** loses its content when the user navigates out of the page and comes back by using the **Back** button of the browser.
1414

15-
Possible solutions:
15+
Browsers automatically preserve the content in such scenario only for form elements like `<textarea>`, `<input/>` and so on. **RadEditor**, however, is an editable DOM element that the browser does not consider as a form element field and does not preserve its contents automatically.
16+
17+
**Possible solutions**:
1618

1719
* For **Chrome** and **Firefox**: You can use the `window.onbeforeunload` event in order to detect that user navigates out of the page and save the content of **RadEditor** in its own hidden `<textarea>`.
1820

@@ -25,17 +27,17 @@ Possible solutions:
2527

2628
<script>
2729
window.onbeforeunload = function (ev) {
28-
$find("<%= RadEditor.ClientID %>").saveContent();
30+
$find("<%= RadEditor1.ClientID %>").saveContent();
2931
};
3032
</script>
3133

3234

33-
* For all browsers: IE cannot preserve the content during `window.onbeforeunload` and you can either save the content in the `<textarea>` while text is being typed in, or by using a `setTimeout` to not affect the performance of your page.
35+
* For all browsers: IE cannot preserve the content during `window.onbeforeunload` and you can either save the content in the `<textarea>` while text is being typed in, or by using a `setInterval` to not affect the performance of your page.
3436

3537
>caption Example 2: Solution with `onkeyup` event.
3638

3739

38-
<telerik:RadEditor runat="server" ID="RadEditor" RenderMode="Lightweight" OnClientLoad="OnClientLoad"></telerik:RadEditor>
40+
<telerik:RadEditor runat="server" ID="RadEditor1" RenderMode="Lightweight" OnClientLoad="OnClientLoad"></telerik:RadEditor>
3941

4042
<a href="http://www.telerik.com/">Navigate to www.telerik.com</a>
4143

0 commit comments

Comments
 (0)