This is a migrated thread and some comments may be shown as answers.

Image src changed to include site name

1 Answer 32 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Terri-Lynn
Top achievements
Rank 1
Terri-Lynn asked on 27 Sep 2011, 08:36 PM
Hi all:
I have a page created that has a RadEditor on it, with ImageManager enabled.  When a user finds the image they want to insert, it pulls the site name along with the file path.  Here are my settings for the editor:
 

myEditor.ImageManager.ViewPaths =

 

New String() {"~/i"}

 


This works fine as the user is directed to this folder.  On insert, however, the src to the image holds details further back like this:
<img alt="" src="/mysite/i/Atlas_48.png" />

Is there a way to NOT have the '/mysite/' show up?  I have this on a test server, and when I push it live my site name usually changes (ex. mysitedev turns to mysite), so I need to do a mass update with find and replace.  I'm guessing I'm missing something.  Any help is greatly appreciated.

Thanks,
TL

1 Answer, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 30 Sep 2011, 10:44 AM
Hello Terri-Lynn,

Review the following online help article: OnClientPasteHtml. In this article you can find information of how to modify the image just before pasting it in the editor's editing area. The example demonstrates how to check whether the inserted image through the Image manager has an "alt" attribute set and if it doesn't then urge the user to enter an "alt" attribute name, but what you need to do is modify the src attribute of the image (you can use a regular expression here).

Greetings,
Stanimir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Editor
Asked by
Terri-Lynn
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Share this question
or