generic error when adding folders

2 posts, 0 answers
  1. Mark
    Mark avatar
    1 posts
    Member since:
    Jun 2013

    Posted 31 Jul 2013 Link to this post

    I downloaded and studied the example for implementing a DBContentProvider for the RadFileExplorer. Afterwards I decided to try my hand at it but have run into an issue that has me at a loss. When I add a subfolder to my root the file editor throws a generic windows.alert error messasge that simply displays the subfolder path. After dismissing the alert the file editor will refresh with the subfolder appearing in the right-hand grid...but it does not appear as a child node of the root in the treeview. If I click the 'refresh' button then everything is fine...the subfolder appears in both the treeview, as a child node of the root, and in the grid.

    I opened both the example and my project in VS and set a breakpoints in the 'ResolveRootDirectoryAsTree' method of each. Running the repro steps I discovered that in my implementation the breakpoint is hit twice...once before the alert message box and a second after dismissing. Both times the path argument is 'Root/'. The same operation on the example code has the breakpoint being hit four times...
    'Root/'
    'Root/NewFolder/'
    'Root/'
    'Root/'

    A close look at the 'DirectoryItem' generated in the method shows no differences...the full path and location properties of both the parent and it's child are the same for both my code and Teleriks. Tracing through the code shows nothing different either. So my question is this...where in the telerik code-base is this alert message being generated and what error condition is it intended to convey??

    it is a standard window.alert message box with a title of "Message from webpage" and a subject of "Root/NewFolder/"...that's it, no error message, just the full path of the newly added subfolder.

    BTW: to setup for debugging the issue I deleted all the example 'Items' but the root folder. Also my implementation uses LinqToSql to manage two tables...dbo.Directory and dbo.Content, rather than a single 'Items' table as the example does. For that reason posting code with this thread would be pointless.

    Has anyone else seen this error dialog being thrown when adding a folder?? If so, any suggestions as to where to look??
    -mark


  2. Vessy
    Admin
    Vessy avatar
    1385 posts

    Posted 06 Aug 2013 Link to this post

    Hello Mark,

    I can only guess what might be causing the experienced issue, without seeing your implementation of the FileBrowserContentProvider. What I would suggest you is to debug the content provider and see which is the exact part of the code where the error is thrown.

    Basically, this is what happens when you try to create a folder (I am giving you the logic from the provided by us DB content provider) - after the content provider's CreateDirectory is called, it checks what the value of the data server's CreateDirectory is:
    DBContentProvider.cs
    public
    override string CreateDirectory(string location, string name)
    {
        if (dataServer.ItemExists(String.Format("{0}{1}", location, name)))
            return "Directory with the same name already exists!";
     
        string error = dataServer.CreateDirectory(name, location);
        return !String.IsNullOrEmpty(error) ? String.Format("{0}{1}", location, name) : String.Empty;
    }

    If the result of the data server's create directory is an empty string, that means the directory has been created successfully, otherwise a popup with the path to the folder appears. This is why I assume that the file is successfully added to the database (since it is visible after a Refresh), but for some reason the content provider does not know that.

    If the above insights are not helpful in solving the case, could you, please, prepare a sample fully runnable project including all the needed dependencies (content provider, Data base, etc.) so we could examine it on our side?

    Looking forward to hearing from you,
    Veselina Raykova
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top