New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Cancel Enter key execution in the content area


Cancel the Enter key event execution in the content area of RadEditor.


Sometimes you may need to cancel the Enter key execution for example in content validation scenarios. The section below will show you how to do that.


RadEditor has a built-in EnterNewLine command that captures the Enter key event.

To cancel the Enter, you need to handle the OnClientCommandExecuting event of RadEditor and cancel the EnterNewLine command, which will prevent the execution of the Enter key:

<telerik:RadEditor Id="RadEditor1" runat="server" OnClientCommandExecuting="OnClientCommandExecuting" ... />
function OnClientCommandExecuting(editor, args)  {
    if (args.get_commandName() == "EnterNewLine") {
In this article