FileExplorer with custom provider works in dev environment but not on the live server

2 posts, 0 answers
  1. Warren
    Warren avatar
    2 posts
    Member since:
    Jan 2011

    Posted 28 Apr 2012 Link to this post

    i'm using a custom provider to prevent the control from listing a settings file in each folder. it works fine in my development environment but on the live server if the custom provider is used, the control will not list any files under a folder. the wait indicator spins and spins and the files never load. i tested the control on the live server without the custom provider and it works fine.  i'm using the provided example for the custom provider and did not make any changes other than the IsFiltered method. any ideas?

    public class CustomProvider : FileSystemContentProvider

        {

            public CustomProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)

                : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)

            { }

            public override DirectoryItem ResolveDirectory(string path)

            {

                DirectoryItem originalFolder = base.ResolveDirectory(path);

                FileItem[] originalFiles = originalFolder.Files;

                List<FileItem> filteredFiles = new List<FileItem>();

                // Filter the files

                foreach (FileItem originalFile in originalFiles)

                {

                    if (!this.IsFiltered(originalFile.Name))

                    {

                        filteredFiles.Add(originalFile);

                    }

                }

                DirectoryItem newFolder = new DirectoryItem(originalFolder.Name, originalFolder.Location, originalFolder.FullPath, originalFolder.Tag, originalFolder.Permissions, filteredFiles.ToArray(), originalFolder.Directories);

                return newFolder;

            }

            public override DirectoryItem ResolveRootDirectoryAsTree(string path)

            {

                DirectoryItem originalFolder = base.ResolveRootDirectoryAsTree(path);

                DirectoryItem[] originalDirectories = originalFolder.Directories;

                List<DirectoryItem> filteredDirectories = new List<DirectoryItem>();

                // Filter the folders 

                foreach (DirectoryItem originalDir in originalDirectories)

                {

                    if (!this.IsFiltered(originalDir.Name))

                    {

                        filteredDirectories.Add(originalDir);

                    }

                }

                DirectoryItem newFolder = new DirectoryItem(originalFolder.Name, originalFolder.Location, originalFolder.FullPath, originalFolder.Tag, originalFolder.Permissions, originalFolder.Files, filteredDirectories.ToArray());

                return newFolder;

            }

            private bool IsFiltered(string name)

            {

                return name == Web.SETTINGS_FILENAME;

            }

  2. Warren
    Warren avatar
    2 posts
    Member since:
    Jan 2011

    Posted 30 Apr 2012 Link to this post

    i downgraded the project from .net 4.0 to .net 3.5 and that fixed the problem
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top