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

[Solved] The relative virtual path '../Images' is not allowed here

1 Answer 518 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tijs
Top achievements
Rank 1
Tijs asked on 29 May 2009, 07:24 AM
Hello,

I am trying to use the Image Dialog in the Editor, but have a problem: The ImageManager seems to require absolute paths, while I need to use a relative path. This is the code I have now:

 

<ImageManager ViewPaths="../Images" UploadPaths="../Images" DeletePaths="../Images" />

I would like to avoid the following:
<ImageManager ViewPaths="~/Directory/Images" UploadPaths="~/Directory/Images" DeletePaths="~/Directory/Images" />

Is there a way to get this to work?

 

1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 01 Jun 2009, 01:02 PM
Hi Tijs,

The relative syntax is not currently supported, because RadEditor uses the so-called FileBrowserContentProvider abstraction which allows for the editor dialogs to be hooked into various CMS systems and/or databases.

The default implementation of the FileBrowserContentProvider has no notion of Page - hence, it is not able to determine in which context the relative path should be resolved in. E.g. here is some code from the provider:

public override DirectoryItem ResolveRootDirectoryAsTree(string path)
{
//No Page object here, just HttpContext object here
string physicalPath = Context.Server.MapPath(path);


Hence, the easiest way to "feed" relative paths to the editor is not declarative, but uses a little bit of code, e.g.:

string path = Page.ResolveUrl("./images");
RadEditor1.ImageManager.ViewPaths = new string[] { path };


I hope this helps,
Tervel
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.
Tags
Editor
Asked by
Tijs
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or