Hi,
I've noticed that TextChanged event is fired server side if I change modes (from Design to HTML) and do nothing else.
This gives the impression that there has been change to the content, but there hasn't.
Is there any way to address this?
Thanks!!
2 Answers, 1 is accepted
0
Accepted
Rumen
Telerik team
answered on 01 Sep 2009, 02:49 PM
Hi VF,
The RadEditor for ASP.NET AJAX was intended to be as simple to configure as
possible - and we decided to follow the familiar pattern of TextBox as
this is in fact how the editor is used in almost all cases. The
development paradigm is that the editor is a part of a larger page that
has some other means of making a postback or a callback - and the
editor should not interfere in it. Thus, the Submit and Cancel buttons
were removed.
Since the new editor does not offer any more an Update button, it is not longer registered as a postback control and the OnTextChanged event
is not implemented. You can use it only for backward compatibility to
avoid server errors but this event does not do anything.
Our recommendation is to 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.