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

[Solved] Issue with setting paths on ImageManager

2 Answers 139 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ilia
Top achievements
Rank 1
Ilia asked on 17 Jun 2008, 01:27 PM
following code seem to have no effect:
<%  
    string[] paths = new string[] {"~/local"};  
    editor1.ImageManager.ViewPaths = paths;  
    editor1.ImageManager.UploadPaths = paths;  
    editor1.ImageManager.DeletePaths = paths;  
%> 

i.e. ImageManager has upload function disabled and shows no folders.

However setting same path using xml works just fine:
<ImageManager ViewPaths="~/local" DeletePaths="~/local" UploadPaths="~/local" /> 
so clearly accessibility of the folder is not an issue.

In my case I do need to set path dynamically, so this workaround is not good enough.

Same problem seem to apply to other file managers as well.

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 17 Jun 2008, 03:14 PM
Hi Ilia,

Please, try the following code by placing it in the Page_Load eventhandler in the codebehind:

string[] viewImages = new string[] { "~/local" };
string[] uploadImages = new string[] { "~/local" };
string[] deleteImages = new string[] { "~/local" };

if (!IsPostBack)
{
   editor1.ImageManager.ViewPaths = viewImages;
   editor1.ImageManager.UploadPaths = uploadImages;
   editor1.ImageManager.DeletePaths = deleteImages;
}


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ilia
Top achievements
Rank 1
answered on 17 Jun 2008, 04:26 PM
That worked, thanks.
However i question the difference... is code render block executed too late or something?
Tags
Editor
Asked by
Ilia
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Ilia
Top achievements
Rank 1
Share this question
or