Image url overwritten when reposition it

3 posts, 0 answers
  1. AM
    AM avatar
    11 posts
    Member since:
    Aug 2007

    Posted 12 Feb 2009 Link to this post

    Hi,

    In the RadEditor, I used Image Manager to upload an image and then added it to the Editor. But if I move the image to a new position, the relative url image path get rewritten to the absolute url (<IMG alt="" src="/MyProject/content/Images/$2_Bill_Concert.jpg"> ===> <IMG alt="" src="http://localhost/MyProject/content/Images/$2_Bill_Concert.jpg"> ). I tried using "

    HtmlContent.ContentFilters =

    EditorFilters.None;" and also 

     

    "StripAbsoluteImagesPaths

     

    ="true". None of those seemed work. Is there any other way to fix this. I want the image url to stay relative.

    Thanks in adavnce for your help.
    AM

     

  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 16 Feb 2009 Link to this post

    Hi AM,

    We are aware of this behavior and the problem is inherent to IE - during drag & drop it automatically converts all links to absolute.

    To workaround the problem we implemented a new content filter named StripPathsFilter. The content filter will allow the developer to specify an array of strings that will be stripped from the absolute path and make it relative. Here is an example demonstrating how to configure the filter and strip the http://localhost/EditorFixes/ string from the absolute path:


    <script type="text/javascript"
    function onclientload(editor) 
         editor.get_filtersManager().add(new Telerik.Web.UI.Editor.StripPathsFilter(["http://localhost","/EditorFixes/"])); 
    </script> 
    <rad:RadEditor ID="radEdit" runat="server" OnClientLoad="onclientload"

    The Telerik.Web.UI.Editor.StripPathsFilter method receives as a parameter an array of strings that will be stripped from the absolute links.

    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 18 Dec 2009 Link to this post

    Works perfect!

    Marc
Back to Top