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

File Explorer in User Control

17 Answers 273 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Dave Miller
Top achievements
Rank 2
Dave Miller asked on 08 Jul 2009, 02:46 PM
Is it possible to use the File explorer in a dynamically added user control?

Thanks,
Dave

17 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 10 Jul 2009, 03:18 PM
Hi Dave,

Yes, this is possible and for your convenience I have attached a working project in which the RadFileExplorer control is loaded dynamically.


Kind regards,
Fiko
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.
0
Dave Miller
Top achievements
Rank 2
answered on 11 Jul 2009, 05:51 PM
Fiko,

Thanks for the response but I still am having problems and I believe I should have gone into more detail on my first post.

I uses a database to dynamically generate many site pages from one aspx page. On that page I have a  asp:panel that  loads different user controls into the page as needed. I also use URL rewriting on this page. I have many different user controls utilizing various Rad Contols, grids, scheduler, etc. which all work fine. I did have to add some javascript onto some of the controls for this to work with the URL rewriting.

I believe I may be having problems with both dynamically loading the control and with the rewriting. I have set up some very simple test pages to try and work thru the problem.

First I created a page with the File Explorer in it to make sure I wasn't having permission problems and it works fine.

Next I created a test page with the code you supplied to dynamically add the File Explorer and while it creates, deletes, moves and renames folders it will not upload files. It will rename, move, view and delete files but I get a "path/filename : Cannot Write To Target Folder" error when I try to upload.

This is the same thing that happens when I use my normal routine to load the File Explorer

I then loaded the control into my page with the URL rewriting and when I click on a folder the loading panel comes up, I get an "Invalid argument" error on the page and the loading panel does not close.

The javascript below is what I use on url rewriting page(s) with dynamically loaded user controls using controls like the the Radgrid. This works great.

<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">  
<script language="javascript" type="text/javascript">  
 
        //<![CDATA[  
              
            Sys.Application.add_load(function()     
            {  
            var   form   =   Sys.WebForms.PageRequestManager.getInstance()._form;     
            form._initialAction   =   form.action   =   window.location.href;     
            });  
              
 
            //]]>  
</script>  
</telerik:RadCodeBlock> 

If I add this to the Control with the File Explorer on the url rewite page and click on a folder I get :

callback loading error:

the target 'customCntl$RAdFileExplorer1' for the callback could not be found or did not implement ICallbackEventHandler.

It will however allow me to hit the refresh button or create a new folder on the File Explorer and if I do so it will now work. It will allow me to do everything as above but upload a file. If I try to upload a file I get the "path/filename : Cannot Write To Target Folder" error and after that the "callback loading error:" above if I click on a folder. But if I hit the refresh button or create a new folder it works again allowing me to do everything except upload a file.

I believe the 2 issues are uploading a file with the dynamically added control and somehow initializing the control on a page with URL rewrites.

Any help would be greatly appreciated!

Thanks,
Dave

0
Lini
Telerik team
answered on 16 Jul 2009, 01:24 PM
Hello Dave,

We are not sure what causes the problems you experience with the FileExplorer control, but we have two suggestions for you: first, you can try updating to the latest internal build from our site (http://www.telerik.com/account/latest-internal-builds.aspx). The current internal build features some fixes that might help with the "Cannot write to target folder" when loading the control dynamically on the page. If the internal build does not help, please open a formal support ticket and send us a simple test project, where we can see the problems. Thank you in advance for your cooperation!

Regards,
Lini
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.
0
Dave Miller
Top achievements
Rank 2
answered on 16 Jul 2009, 02:05 PM

Lini,

Thanks for the reply. I have updated to the current build and am still not able to upload with the dynamically added File Explorer.

 

The attached project from Fiko's post above does not work for me. It does everything but upload.

Please let me know if it allows you to upload a file.


Best regards,

Dave

0
Accepted
Lini
Telerik team
answered on 17 Jul 2009, 08:25 AM
Hi Dave,

I think the problem in Fiko's example is that the FileExplorer is added to the page control tree too late and cannot load its ViewState (upload paths, view paths) in time when there is a file upload. I think in the example, the control is added in the Page_Load event. That is why it refuses to save the file (upload paths is still empty). To fix this, you can try to load the user control earlier in the page lifecycle (e.g. in the Init event):

Default.aspx.cs:

public partial class _Default : System.Web.UI.Page 
    protected override void OnInit(EventArgs e) 
    { 
        base.OnInit(e); 
        Control fileExplorerControl = this.LoadControl("WebUserControl.ascx"); 
        this.Form1.Controls.Add(fileExplorerControl); 
    } 

I hope this helps.


Greetings,
Lini
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.
0
Dave Miller
Top achievements
Rank 2
answered on 22 Jul 2009, 12:46 PM
Lini,

Loading the File Explorer in the OnInit event corrected the errors.

Thanks for the help,
Dave
0
Michael
Top achievements
Rank 1
answered on 07 Oct 2010, 10:48 AM
Hi Dave,

I am trying to implement a one page website using user controls as my content pages and using urlrewriting to change parameters to load the user controls.

Were you successful in getting this to work? As I have been trying to update my url address bar with the correct url when a radtab is clicked but it doesnt change.

Any insight would be great.

Thank you.

Mike
0
Fiko
Telerik team
answered on 12 Oct 2010, 11:58 AM
Hello Michael,

I am not quite sure that I understood your requirements. Could you please provide more information about the expected result? It will be best if you send me some screenshots of the expected behavior.

Regards,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 12 Oct 2010, 12:11 PM
Hello Fiko,

I have opened a thread with the same question below.

http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/radtabstrip-url-rewriting.aspx

Mike
0
Dave Miller
Top achievements
Rank 2
answered on 12 Oct 2010, 01:55 PM

Mike,

I will post a reply under your new thread.

 

Dave

0
Rohan
Top achievements
Rank 1
answered on 22 May 2012, 04:04 PM
Hi Fiko,

I want to add user control to file explore upload window . how can i do this ,please provide any reference or document.
0
Dobromir
Telerik team
answered on 23 May 2012, 10:07 AM
Hi Rohan,

RadFileExplorer does not offer the functionality to customize its Upload dialog out-of-the-box, and adding a user control to the dialog is not possible. However, it is possible to add custom fields to the dialog using the approach provided in this forum thread.

Greetings,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Rohan
Top achievements
Rank 1
answered on 23 May 2012, 10:15 AM
Hi Dobromir,

Thanks for replay. 
Is there any way to replace file explorer upload window to my custom popup window.
0
Dobromir
Telerik team
answered on 28 May 2012, 06:45 AM
Hi Rohan,

In short, no, the Upload dialog's functionality is tightly incorporated with the RadFileExplorer itself and control cannot be hooked up with different upload tool.

However, It is possible to use a third-party upload control and use the explorer as the file/folder listing tool but some of the upload related functionality will not be available. To add a custom dialog to the control you can use a popup control (i.e. RadWindow) that can be shown from a custom toolbar button.

For your convenience, I have attached a sample page demonstrating the above mentioned approach.

All the best,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Cavit
Top achievements
Rank 1
answered on 10 Jul 2015, 04:19 PM

Hi Lini,

I am adding a user control which contains RadFileExplorer. I add the control during Init as mentioned in the thread.

 The toolbar of RadFileExplorer Works fine. However when I want to expand the the content of a folder from tree view;I get an "There was an error in the call back"

 

The odd Things is that if I click on a toolbar button first, then I can expand the content of the folder later,

 Do you have any idea ?

0
Cavit
Top achievements
Rank 1
answered on 13 Jul 2015, 03:19 PM

My user control is shown in an updatepanel and I have implemented my own custom FileContentProvider.

 

0
Vessy
Telerik team
answered on 15 Jul 2015, 12:09 PM
Hi Cavit,

The most probable reason for the experienced problem is the Update panel wrapping FileExplorer. The FileExplorer's functionality is heavily based on client-side callbacks and it is highly recommended not to be externally ajaxified. That's why, could you please disable the AJAX and see if the problem still exists?

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
FileExplorer
Asked by
Dave Miller
Top achievements
Rank 2
Answers by
Fiko
Telerik team
Dave Miller
Top achievements
Rank 2
Lini
Telerik team
Michael
Top achievements
Rank 1
Rohan
Top achievements
Rank 1
Dobromir
Telerik team
Cavit
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or