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

Remove the entire anchor tag with the text by overriding the Unlink command of RadEditor


Product RadEditor for ASP.NET AJAX


See how to override the default Unlink command of RadEditor in order to remove the whole link/anchor and its text. The default behavior of the Unlink command is to remove only the <a> tag and to keep the text inside it.


You can delete the whole anchor along with the text inside it using the following Unlink command override:

    function OnClientCommandExecuting(editor, args) {
        var commandName = args.get_commandName();

        if (commandName == "Unlink") {

<telerik:RadEditor runat="server" ID="RadEditor1" OnClientCommandExecuting="OnClientCommandExecuting">
            a {
                background-image: url(images/Icon2.png) !important;
                background-repeat: no-repeat !important;
        Some text and an <a id="id1" name="id2" alt="test">Anchor</a> in the content area.
        <telerik:EditorContextMenu TagName="A">
            <telerik:EditorTool Name="SetLinkProperties" ShowText="true" />
            <telerik:EditorTool Name="Unlink" ShowText="true" />
In this article