File Explorer in User Control

18 posts, 1 answers
  1. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 08 Jul 2009 Link to this post

    Is it possible to use the File explorer in a dynamically added user control?

    Thanks,
    Dave
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 10 Jul 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 11 Jul 2009 Link to this post

    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

  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 16 Jul 2009 Link to this post

    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.
  6. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 16 Jul 2009 Link to this post

    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

  7. Answer
    Lini
    Admin
    Lini avatar
    2144 posts

    Posted 17 Jul 2009 Link to this post

    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.
  8. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 22 Jul 2009 Link to this post

    Lini,

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

    Thanks for the help,
    Dave
  9. Michael
    Michael avatar
    18 posts
    Member since:
    Jun 2009

    Posted 07 Oct 2010 Link to this post

    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
  10. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 12 Oct 2010 Link to this post

    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
  11. Michael
    Michael avatar
    18 posts
    Member since:
    Jun 2009

    Posted 12 Oct 2010 Link to this post

    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
  12. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 12 Oct 2010 Link to this post

    Mike,

    I will post a reply under your new thread.

     

    Dave

  13. Rohan
    Rohan avatar
    94 posts
    Member since:
    Jul 2012

    Posted 22 May 2012 Link to this post

    Hi Fiko,

    I want to add user control to file explore upload window . how can i do this ,please provide any reference or document.
  14. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 23 May 2012 Link to this post

    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.
  15. Rohan
    Rohan avatar
    94 posts
    Member since:
    Jul 2012

    Posted 23 May 2012 Link to this post

    Hi Dobromir,

    Thanks for replay. 
    Is there any way to replace file explorer upload window to my custom popup window.
  16. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 28 May 2012 Link to this post

    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.
  17. Cavit
    Cavit avatar
    16 posts
    Member since:
    Apr 2015

    Posted 10 Jul 2015 in reply to Lini Link to this post

    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 ?

  18. Cavit
    Cavit avatar
    16 posts
    Member since:
    Apr 2015

    Posted 13 Jul 2015 in reply to Cavit Link to this post

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

     

  19. Vessy
    Admin
    Vessy avatar
    1385 posts

    Posted 15 Jul 2015 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017