This is a migrated thread and some comments may be shown as answers.

Set value for Content different than get value

3 Answers 49 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Glavin
Top achievements
Rank 1
Glavin asked on 03 Nov 2010, 02:46 PM
I am working on a CMS that tracks changes and I am having difficulty with the Radeditor returning consistent values. If I load the edit page that has the Content Property databound, and submit the form without changing anything, the returned content value is different. It seems to return the properties of a and img tags in different order than the one it was sent thus telling the system there was a change to the page when there wasn't one.

Anyone know how to fix this issue?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Nov 2010, 03:21 PM
Hi Michael,

The content area of RadEditor is editable IFRAME which uses the underlining Rich Text Editing engine of the browser where it operates. The observed behavior is browser behavior and it is the browser that rearranges the attributes order in the HTML tags. You can reproduce the same behavior in the attached HTML page having an editable IFRAME elements in it as well as in our competitors' editors.

Unfortunately, it is not possible to control this browser behavior with code and override it.

Sincerely yours,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Glavin
Top achievements
Rank 1
answered on 03 Nov 2010, 03:24 PM
When looking at possible work arounds for the issue I ran across the event for the control that will fire if the content has changed. Does this event fire erroneously due to the mentioned browser behavior, or does it only fire if the user changes the content?
0
Rumen
Telerik team
answered on 03 Nov 2010, 03:28 PM
Hello Michael,

RadEditor for ASP.NET AJAX is not registered as a postback control and the OnTextChanged event is not implemented. You can use it only for backward compatibility with the classic version to avoid server errors but this event does not do anything.

You can implement the desired functionality yourself by storing the content in some ViewState variable and on postback to compare the current content with the content saved in this variable. You can obtain the content on the client using the editor.get_html(true) method and check whether it is changed by attaching your code to the onkeydown event using the attachEventHandler method.

Please, note that there is not a reliable way to check whether the content is modified on the server because the content is validated and modified by the browser and the RadEditor's built-in content filters. For example if you load non well formed content in the editor then the editor and the browser will change it even without user interaction and when you save it the content will be different from the initial one.

In addition as in your scenario, the browser will reorder the attributes in the tags and the validation will fail again.

Best regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Glavin
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Glavin
Top achievements
Rank 1
Share this question
or