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

Image Manager +Upload Not working on a codeless save in a Database

5 Answers 112 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jorge Pardo
Top achievements
Rank 1
Jorge Pardo asked on 16 May 2008, 06:10 AM

I have tried codeless save in a Database for asp.net AJAX RadEditor, its working fine for text. I am able to edit and save the changes.  But when I tried inserting an Image from local drive it doesnt allow me to because the Image Manager +Upload can't be clicked.

I am using SQL SERVER 2005 using ObjectDatasource and FormView


Thank you very much.

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 May 2008, 08:19 AM
Hi Fouad,

The problem is odd because the Image manager does not have nothing to do with the Save functionality of RadEditor at all. The problem could be due to that you have not configured the Image manager upload paths. Please, review the following help article Images and
this KB article Uploading images to the server (upload tab is for more information on how to enable the Image Upload and Insert in RadEditor.

Please, note that  it is not possible to access and produce content that cotnains images referring to your local drive, because the images will only be visible if the html content is accessed from your own computer - and the images will be invisible for any other users accessing the same content from other machines.

In order to use images, they need to be accessible using HTTP protocol - that is, it means they must be uploaded to a web server (which can be your own computer of course, only that the images are provided by the web server software, and not by the operating system). For that reason you can use the Image manager to upload your local images from your hard disk to the server. After that you will be able to insert them from the Image manager.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jorge Pardo
Top achievements
Rank 1
answered on 16 May 2008, 01:47 PM

Thank you for your prompt response, its working now.  One more question can I dynamically set the properties of ImageManager at runtime

    ImageManager-ViewPaths="~/Images"
    ImageManager-UploadPaths="~/Images"
    ImageManager-DeletePaths="~/Images" >

 or on the fly, because I plan to dynamically create folder per user's New Article everytime they create a new article and use the assigned Article ID as FolderName wherein it will be use to store their files that their article is referencing to.

just like

<telerik:RadEditor ID="RadEditor1" runat="server"
    ImageManager-ViewPaths="~/articles/" + articleid.text + "/"
    ImageManager-UploadPaths="~/articles/" + articleid.text + "/"
    ImageManager-DeletePaths="~/Images/" + articleid.text + "/"
</telerik:RadEditor>

and so on for the others like media, docs, and flash. 

Thank you very much.

0
Rumen
Telerik team
answered on 16 May 2008, 03:05 PM
Hi Fouad,

Here is how to set the Images paths dynamically:

string[] viewImages = new string[] { "~/Images/" + articleid.text + "/"};
string[] uploadImages = new string[] { "~/Images/New" };
string[] deleteImages = new string[] { "~/Images/New/Articles", "~/Images/New/News" };

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


Please, review the Controls -> RadEditor -> Dialogs section in the help for more information how to configure the paths of the other editor's file browser dialogs.


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jorge Pardo
Top achievements
Rank 1
answered on 23 May 2008, 05:44 PM
I have tried doing what you have written, but the problem is [RadEditor1] is inside the [EditItemTemplate] of [FormView1].  How do I call or set the properties of [RadEditor] inside [FormView1] at Code Behind using C#.
0
Rumen
Telerik team
answered on 26 May 2008, 02:41 PM
Hi Fouad,

Here is an example how to find the editor in a FormView control and set its document manager paths:

    Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound
        If FormView1.CurrentMode = FormViewMode.Edit Then
            Dim myEditor As RadEditor = (DirectCast(FormView1.FindControl("RadEditor1"), RadEditor))

            Dim documents As String() = New String() {"~/Documents"}
            myEditor.DocumentManager.ViewPaths = documents
            myEditor.DocumentManager.UploadPaths = documents
            myEditor.DocumentManager.DeletePaths = documents
        End If
    End Sub

You can download a sample working example demonstrating how this code works from here.


Kind regards,
Rumen
the Telerik team

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