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

[Solved] Applicaiton-relative URLs in Editor

1 Answer 158 Views
Editor
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 23 Apr 2008, 12:20 PM
Hi all.  Is there a way with the Editor control to provide functionality to end-users such that they may embed application-relative URLs within the HTML?  For example, I'd like end-users to be able to have tags like the following:

<a href="~/SomePage.aspx">Some Page</a>
<img src="~/images/someImage.gif" />

To have such references render within the WYSIWYG editing mode would be ideal - is there a way to support that?  I am thinking that a custom filter could address the issue for Preview mode, but is there a way to handle this in the editing mode?

1 Answer, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 24 Apr 2008, 04:00 PM
Hello,

The editor is rendered in the browser as a client control, so it has no knowledge where the current application directory is. As you already pointed out, the only way to use application relative URLs is to have a custom client filter, which will replace the ~ with the current application folder on the client. You can also have another filter on the server, which converts the URLs back to application relative (i.e. starting with "~/"). This way the editor content will be stored with relative URLs and you will be able to move the application without breaking the links.

Greetings,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
mike
Top achievements
Rank 1
Answers by
Lini
Telerik team
Share this question
or