Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Editor > Custom Link Dialog Issues in Firefox, Chrome, and Safari
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Custom Link Dialog Issues in Firefox, Chrome, and Safari

Feed from this thread
  • Michael Weiss avatar

    Posted on Jun 21, 2011 (permalink)

    Hi,

    I am using a custom link dialog copied exactly from http://mono.telerik.com/Editor/Examples/CustomDialogs/DefaultCS.aspx with a few modifications. I was having an issue where editing an existing link would result in a "double link" of 2 nested <a> tags. I thought the problems must be with my modifications of the example, but now I realize that the problem exists in the example on the telerik website at the link I provided.

    For example, in Chrome, selecting the word "semantic", bringing up the link dialog, and entering http://www.google.com for the url, and then pressing Insert Link, results in this:

    <span><a href="http://www.google.com/">semantic</a></span>

    After selecting "semantic" again, bringing up the link dialog again (which binds correctly), and then pressing Insert Link, I get the following code:

    <span><a href="http://www.google.com/" name="semantic"><span><a href="http://www.google.com/">semantic</a> </span></a> </span>

    However, after performing the same two operations in IE, it creates this code:

    <a href="http://www.google.com/">semantic</a>

    which is correct. Is there some sort of hotfix for this issue, or any way to insert code to work around it?

    Thank you,

    Michael Weiss


  • Rumen Rumen admin's avatar

    Posted on Jun 23, 2011 (permalink)

    Hello Michael,

    To fix the problem just delete the selected content with editor.get_document().execCommand("Delete", null, false); and after that paste the new one at cursor position in the Callback function of the custom dialog:

    ...
    var myCallbackFunction = function(sender, args)
    {
    editor.get_document().execCommand("Delete", null, false);
    editor.pasteHtml(String.format("<a href={0} target='{1}' class='{2}'>{3}</a> ", args.href, args.target, args.className, args.name));
    }


    Best regards,
    Rumen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  • Michael Weiss avatar

    Posted on Jun 23, 2011 (permalink)

    Hi Rumen,

    The line of code you suggested has fixed the problem. Thanks for the quick and accurate reply.

    Best,
    Michael

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Editor > Custom Link Dialog Issues in Firefox, Chrome, and Safari