i need to capture the new content of the editor in paste command.
i checked all the forums and i didn't get any solution for this.
please help me in this issue.
in which i can get the new value of editor.
Thanks & Regards,
1 Answer, 1 is accepted
answered on 20 Feb 2009, 12:17 PM
In the upcoming Q1 2009 "Futures" release of RadControls for ASP.NET AJAX, the OnClientPasteHtml event of RadEditor will be fired when the onpaste browser event is executed. This will allow the developer to obtain and modify / clean only the pasted, but not the whole content inside the editor.
Here is a sample example that demonstrates how to attach to the Paste command:
function OnClientPasteHtml(sender, args)
var commandName = args.get_commandName();
var value = args.get_value(); //this is the pasted content
if (commandName == "Paste")
alert("original pasted content: " + value);
var newContent = "modified content"; //write here a regular expression that will strip the <h1>, <h2>, <h3>, etc tags
alert("modified pasted content" + newContent);
args.set_value(newContent); //insert the modified content in the editor
The onpaste event will be executed only when the StripFormattingOptions property is not set toNoneSupressCleanMessage, because then the editor does not execute any code to handle the pasted content and it is pasted without modifications by the browser itself.