I use a FileExplore to let to user upload files to a Public Directory, i create the directory dinamically before the user work with the FileExplorer, the problem is that when the user has to work with the FileExplorer and Refresh it the file explorer change the path but thrown me an error called "NonExistingFolder", The implementation work fine but i don't want the error....
So the question is How avoid the error or how i do a best solution
To change the path dinamically i set it when a postback is called in the constructor of the page,
THANKS for helpme
5 Answers, 1 is accepted
Could you verify, that you are resetting the paths of FileExplorer no later than Page_Load? I am asking you this because the Page_load is the latest moment of the page life-cycle when this can be done, and if you are doing it later this may cause many unexpected issues, like the experienced error.
If this is not the case, though, could you try to isolate the issue into a sample fully runnable project and send it for further investigation?
Regards,
Veselina Raykova
Telerik
private static string[] explorerPath;
private static int editIndex;
protected void Page_Load(object sender, EventArgs e)
{
RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(WizardCustomProvider).AssemblyQualifiedName;
if (!base.IsPostBack)
{
. ...
}
else
{
if (HPSceneManager.ActiveScene != null) //My stuffs
{
RadFileExplorer1.TreeView.Nodes.Clear();
explorerPath = new string[] { HPSceneManager.ActiveScene.VirtualFolderUbication };
//explorerPath[0] = explorerPath[0].Replace("~", "/MapVista");
//The explorePath[0] is like "~/Public/Video0/"
RadFileExplorer1.Configuration.ViewPaths = explorerPath;
RadFileExplorer1.Configuration.UploadPaths = explorerPath;
RadFileExplorer1.Configuration.DeletePaths = explorerPath;
//RadFileExplorer1.InitialPath = explorerPath[0];
}
}
Well like i said, this is the only place where i put the code that reset the FileExplorer path, let me know if you want to get the sample project... Thanks again
Lic. Iran Reyes Fleitas
Faculty of Mathematics and Computer. Havana University
The provided information indeed was not enough for me to replicate the issue and I will need to examine the mentioned sample project in order to be able to provide more to the point help. Please, ensure that the project is fully runnable and includes all the needed dependencies (like the used custom content provider).
Thank you in advance for your cooperation.
Regards,
Veselina Raykova
Telerik
So you are saying there is no way to dynamically change the paths after postback.
Is there any way to send a client side message for the FileExporer to refresh it's control?
Hello Robert,
The provided path must point to a concrete file that is present in the currently shown file list (i.e., in the current folder). If you point the control to a folder that is not yet opened, it cannot navigate to the desired file, because the file list is obtained via a separate request only after the folder is shown to the client, so the control does not know whether the desired file exists yet.
If those conditions are met, setting the InitialPath will work in postback events like Button.Click as well. I will include this information in our documentation and I am also attaching here a short video that shows the expected behavior as a reference.
As for client-side methods—the control offers rich API: http://docs.telerik.com/devtools/aspnet-ajax/controls/fileexplorer/client-side-programming/overview. I believe you will find useful the refresh and set_currentDirectory methods interesting.
Regards,
Telerik