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

[Solved] CodeBehind Editor can't search for extensions properly

2 Answers 41 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chase Florell
Top achievements
Rank 1
Chase Florell asked on 26 Sep 2008, 11:27 PM
I can get my editor to work properly if I put it in the ASPX page, but if I try and initialize it in the code behind, I can't seem to be able to upload files.  I get an error saying that my file extension is invalid.

    Private Sub InitializeEditor()  
 
        Dim Editor1 As New RadEditor  
        Editor1.ID = "RadEditor1" 
        Editor1.AutoResizeHeight = False 
        Editor1.EnableResize = False 
        Editor1.ToolsFile = "~/App_Assets/Other/News_Tools.xml" 
        Editor1.Width = 400  
        Editor1.Height = 400  
        Editor1.Skin = "Office2007" 
        Editor1.ImageManager.ViewPaths = New String() {"~/User_Assets/Images"}  
        Editor1.ImageManager.DeletePaths = New String() {"~/User_Assets/Images"}  
        Editor1.ImageManager.UploadPaths = New String() {"~/User_Assets/Images"}  
        Editor1.ImageManager.SearchPatterns = New String() {"*.jpg,*.jpeg,*.png,*.gif,*.bmp"}  
        EditorPlaceHolder.Controls.Add(Editor1)  
 
    End Sub 

I am trying to upload a png file.
Anyone have any thoughts?

2 Answers, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 29 Sep 2008, 01:46 PM
Hi Chase,

I can see that the string array declaration isn't correct - New String() {"*.jpg,*.jpeg,*.png,*.gif,*.bmp"}  this is array of one string. Please change it as follows and everything will work fine :
Editor1.ImageManager.SearchPatterns = New String() {"*.jpg", "*.jpeg", "*.png", "*.gif", "*.bmp"}

I hope this helps.

Sincerely,
George
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Chase Florell
Top achievements
Rank 1
answered on 29 Sep 2008, 05:05 PM
Ah, that would be it.  Thanks
Tags
Editor
Asked by
Chase Florell
Top achievements
Rank 1
Answers by
George
Telerik team
Chase Florell
Top achievements
Rank 1
Share this question
or